Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bviS4x1XADpX9FkjmEfj/x
Power Automate - General Discussion
Unanswered

Trigger flow when Azure Devops work item is updated to a certain state

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2020 21:09:20 by Microsoft Employee

I want to trigger a flow when a work item is updated to a certain state.  However, once that work item is in that state, I don't want it to trigger anymore.

 

I was hoping to do this by having a way to compare "old value" versus "new value", but didn't see a way to do that.

 

For example, trigger when a work item is transitioned to the "Proposed" state, but once in that state, if the work item is updated with comments, etc, I don't want the flow to trigger.

 

Thoughts?

  • Community Power Platform Member Profile Picture
    on 17 Aug 2023 at 20:31:39
    Re: Trigger flow when Azure Devops work item is updated to a certain state

    I figured it out. I entered the following for the trigger condition.  With what I had posted above, I replaced utcNow() with triggerOutputs()?['body/fields/System_ChangedDate'].

     

    @And(equals(formatDateTime(triggerOutputs()?['body/fields/Microsoft_VSTS_Common_StateChangeDate'], 'yyyy-MM-dd-hh-mm'),formatDateTime(triggerOutputs()?['body/fields/System_ChangedDate'], 'yyyy-MM-dd-hh-mm')),equals(triggerOutputs()?['body/fields/System_State'], 'Ready for UAT'))

     

  • Community Power Platform Member Profile Picture
    on 11 Aug 2023 at 21:51:54
    Re: Trigger flow when Azure Devops work item is updated to a certain state

    This answer doesn't really help.  I understand what you're trying to say.  But I believe the reason @Zaemmel is asking this question is probably similar to my reason -- I'd want the flow to run when a work item is changed to "Ready for UAT" and send a message to a channel on MS Teams.  But as long as the ticket state is "Ready for UAT", when the ticket is commented on, another message is sent via MS Teams and I don't want that.  So I also thought a trigger would help, but I'm having difficulty with that.  I tried the following but realized that this is not going to work either.

     

    @and(equals(formatDateTime(triggerOutputs()?['body/fields/Microsoft_VSTS_Common_StateChangeDate'], 'yyyy-MM-dd-hh-mm'),formatDateTime(utcNow(), 'yyyy-MM-dd-hh-mm')),equals(triggerOutputs()?['body/fields/System_State'], 'Ready for UAT'))

     

    Does anyone have any other suggestions/ideas/help?

     

    Thank you.

  • Brad_Groux Profile Picture
    4,556 on 02 Nov 2020 at 20:35:22
    Re: Trigger flow when Azure Devops work item is updated to a certain state

    Don't worry about the trigger, worry about the operation. Add a condition to the flow, that checks if there is a "proposed" state value. If there is, do nothing. If there is not, put it in a proposed state. Further:

    If you could provide an expanded screenshot of your Flow and steps, your Flow run history, and of any detailed error messages you're receiving we could likely better assist you. Also, for the best results, you may want to review How to write a good forum post.

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

#1
rpersad Profile Picture

rpersad 16

#2
David_MA Profile Picture

David_MA 10 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 8 Super User 2025 Season 1

Overall leaderboard
Loading started