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. Smiley Very Happy

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 178 members 4,571 guests
Please welcome our newest community members: