cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Setting the Created By on DevOps Work Items using Flow

Hi,

 

We have created a flow that generates a number of Work Items that are linked as children when a certain Work Item is created in Azure DevOps.

 

The issue we currently have is that these generated Work Items have the creator of the flow set as the person that created these Work Items.

 

Is it possible to dictate the created by field to the person that creates the Work Item that triggers the flow or is this field not editable in DevOps?

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @Anonymous,


You can use the bypassRules property in the creation of a work item via the Azure DevOps Rest API. This allows you to set the createdby if you have sufficient permissions in the DevOps Project.

https://developercommunity.visualstudio.com/t/change-systemcreatedby/283179

https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/create?view=azure-devops-rest-6.0

 

Below is an example of that.

 

[
  {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "Sample task"
  },
  {
    "op": "add",
    "path": "/fields/System.CreatedBy",
    "value": "Jane Doe"
  },
 {
    "op": "add",
    "path": "/fields/System.ChangedBy",
    "value": "Jane Doe"
  }
]

createdby_changedby_bypassrules_devops.png

 

This example will create a task.

 

createdbytask.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


markbb
Regular Visitor

I'm trying to do the same thing since apparently, DevOps is taking the creator of the flow instead of the submitter of the form.  I did what you put, but it gives me a time out (yellow circle until it finally stops).  I checked the URi in my browser to verify the json data it's calling, and it lists everything.  Any tips?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,832)