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

Sync VSTS with SharePoint

Hi,

 

would like to sync VSTS User Stories wih a SharePoint List. If the record does not already exist, the flow will add it to the specified SharePoint List.

I tried this tamplate:

https://emea.flow.microsoft.com/en-us/galleries/public/templates/1f309980ed8911e6a0e7f98291dcd11a/ad...

 

But I don't realy know how to handle it or it does't work!?

The example filter is: "VSTSID eq @{triggerBody()?['id']}"

If I don't use the filter the flow works but just for the first shot.

 

Thanks for your help!

 

2018-05-05.png

2 REPLIES 2
Community Support Team
Community Support Team

Re: Sync VSTS with SharePoint

Hi @Anonymous,

 

Could you please share a bit more about your SharePoint list?

Do you create a desired column for filter section of "Get items" action within your SharePoint list?

 

If you want to use the "Add new work items from VSTS to a SharePoint list" built-in template to create your flow, you should enter the desired column name in the filter section of "Get items" action for this template to work:6.JPG

I assume that you don't want to create a record in your SharePoint list if the User Story Work Item with same Title has been created in your SharePoint list. I have created a SharePoint list on my side and the data structure of it as below:7.JPG

Note: The VSTSID column is used to store the Work Item ID of your VSTS User Stories. The UserStoryTitle column (Single line of text type column) is used to store the Title of the User Story Work Item of your VSTS.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a "When a work item is created" trigger, specify Account Name, Project Name, Team Name and Type.
  • Add a "Get items" action, specify Site Address and List Name. Filter Query field set to following formula:

 

UserStoryTitle eq '@{triggerBody()?['Fields']?['System_Title']}'

 

9.JPG

 or you could type the following formula:

UserStoryTitle eq 'ID dynamic content of the trigger'

8.JPG

Note: The ID dynamic content is wrapped with single quotes.

 

  • Add a "Compose" action, Inputs set to following formula:

 

utcnow()

 

  • Add a "Condition", click "Edit in advanced mode", type the following formula:

 

@empty(body('Get_items')?['value'])

 

  • Within "If/yes" branch of Condition, add a "Create item" action, specify Site Address and List Name. The VSTSID field set to ID dynamic content of the trigger.

Image reference:10.JPG

 

11.JPG

The flow works successfully as below:12.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Sync VSTS with SharePoint

Hi Kris(@v-xida-msft),

 

thx 4 your help.

I created a new list in SP with new columns/fields.... et voilà it has worked. 😄

Flow don't refrash the names of the columns if you change them in SP. I think, that was the problem.

 

Best regards

Kaspar

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,210)