My flow needs to update a DevOps work item with a hyperlink. This can be done manually through the DevOps user interface by adding an existing item and selecting Hyperlink as the link type. However, in the Flow, the Update Work Item template does not allow Hyperlink as a Link Type. I put Hyperlink into the field, but the update errored with 'Unknown relation type System.LinkTypes.Hyperlink'. I really need this. Please guide me to how I can add the Hyperlink.
Solved! Go to Solution.
I figured out how to do it - it took me all day - but I am tickled to find a solution using the "Send an HTTP Request to Azure DevOps" action.
See the following Flow action where the variable IDOfWorkItem is the work item to be updated and the variable DEVOPSAPIURI is URL: https://dev.azure.com/<organization>/<project>/_apis/wit/workitems/@{variables('IDOfWorkItem')}?api-.... The AddLinkJSON below uses a RelatedItemURL that is in the form "https://....". Setting the Content-Type was one key to getting this to work.
Here's proof:
and the link now appears on the work item
Hi @HeadInTheCloud ,
It seems we can't add hyperlink to work item, please check this similar thread:
Best Regards,
@v-bacao-msft Thanks for the reply to my post. I'm not sure that applies to my issue since I am able to add a Hyperlink to a Work Item via the Web UI by going to the Links Tab and selecting the Add Link - Existing Item drop down option. That opens the form shown below and I can enter the URL and select Hyperlink in the Link Type.
[edit - the UI image is in the next reply]
@v-bacao-msft Thanks for the reply to my post. I'm not sure that applies to my issue since I am able to add a Hyperlink to a Work Item via the Web UI by going to the Links Tab and selecting the Add Link - Existing Item drop down option. That opens the form shown in the first screen shot below and I can enter the URL and select Hyperlink in the Link Type. My problem is that I need to add a link to a Dynamics CRM record to a Work Item in a Flow. Options in the DevOps "Update A Work Item" action allows me to add a link to another Work Item (see second screen shot), but not to a CRM item. IMO, that's an operation Flow should offer. "Create A Work Item" appears to have the same limitation.
Here's what Flow offers me for Link Type options - only links to other work items -
I figured out how to do it - it took me all day - but I am tickled to find a solution using the "Send an HTTP Request to Azure DevOps" action.
See the following Flow action where the variable IDOfWorkItem is the work item to be updated and the variable DEVOPSAPIURI is URL: https://dev.azure.com/<organization>/<project>/_apis/wit/workitems/@{variables('IDOfWorkItem')}?api-.... The AddLinkJSON below uses a RelatedItemURL that is in the form "https://....". Setting the Content-Type was one key to getting this to work.
Here's proof:
and the link now appears on the work item
Thanks for sharing this solution. Only thing I can't seem to figure out is to how to add a comment. I've tried adding these to the JSON with no success
"comment":"sample comment"
"linkcomment":"sample comment"
"link comment":"sample comment"
I've also tried the above with the L & C capitalized in case things are case sensitive
Any guidance is much appreciated.
I haven't added a comment to a work item, but I have retrieved comments with an HTTP request and they are returned in an array. I hope that helps. If you have figured out how to do it, it would be great if you could post the solution.
Hi I realise this is an old post but I was hoping you could help. I have tried to follow your solution but am getting this issue: No api-version was supplied for the "PATCH" request
Sorted it thanks 🙂
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
28 | |
28 | |
26 | |
26 | |
23 |
User | Count |
---|---|
63 | |
51 | |
44 | |
32 | |
30 |