Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation: filter using "old value" after trigger "Field value changed"

Camon Jie November 20, 2023

I want to send a notification after a ticket removed from open Sprint. Now I`m using trigger "Field value changed" and jql condition "Sprint in openSprints()". But this only triggered when a ticket "move to an open Sprint" rather than "move from an open Sprint".

I also tried JQL like {{#changelog.issue.Sprint}}{{fromString|EMPTY}}{{/}} in openSprint() but also not work.

So how could I use old value during JQL contiditon?

3 answers

1 accepted

0 votes
Answer accepted
Camon Jie November 20, 2023

Dear @Bill Sheboy  ,

Sorry for disturb, I found a reply from you, it mentioned "{{#changelog.sprint}}{{from}}{{endDate}}{{/}}", this is really what I need now, but when I try it on my side, it only returns "Sprint name" rather than "Sprint end date".

I also tried "{{#changelog.sprint.endDate}}{{from}}{{/}}", but it return nothing.

Do you have any suggestion, you are my saver!

 

Annotation 2023-11-21 144643.pngAnnotation 2023-11-21 144702.png}}

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2023

Hi @Camon Jie 

I recall the last time I tried this it did not work with just the changelog.  There are a couple of open defects for the changelog not working correctly for list fields like Sprint, Fix Version, etc. inside of automation rules

There are specific smart values for added / removed values from fields for {{fieldChange}} and {{changelog}} and they do not work predictably for list fields: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange-- 

One work-around builds on what @Trudy Claspill described:

  • Create a rule triggered on Sprint Started, and mark each issue as in the sprint scope, such as with a label value such as In-Current-Sprint
  • Create a second rule triggered on a change to the Sprint field, and use a JQL condition to detect if the label is set and the issue is not in the sprint
    • labels IN (In-Current-Sprint) AND sprint NOT IN openSprints()

Kind regards,
Bill

Camon Jie November 21, 2023

Dear @Bill Sheboy ,

    Thanks a lot for your kindly explanation, I totally understand what`s happening now.

 

Regards

1 vote
Trudy Claspill
Community Champion
November 20, 2023

Hello @Camon Jie 

Welcome to the Atlassian community.

Can you show us the complete automation rule you have so far?

 issue not in openSprints()

...will tell you if the current issue is not in an open/Active sprint at the current time.

Camon Jie November 20, 2023

Hello @Trudy Claspill 

    Thanks for your advise. But actually your JQL will also triggered when issue removed from a "not-open Sprint" or from "backlog", not only from "active sprint".

Trudy Claspill
Community Champion
November 20, 2023

Please show us your full automation rule.

We can offer better advice when we have the complete context of your rule.

Camon Jie November 20, 2023

Hello @Trudy Claspill 

Annotation 2023-11-21 142250.png

I`m trying to make this working, seem "{{#changelog.Sprint.startDate}}{{from}}{{/}}" does not return anything.

I just try to get old value of field "sprint" and get "startDate" or “State”, but seem I cannot find them from "#changelog" 

0 votes
Camon Jie November 20, 2023

Trying to find some way workaround: 

 

Use condition "Advanced compare condition" :

{{#changelog.issue.Sprint.startDate.jiraDate}}{{fromString|EMPTY}}{{/}} 

less than

{{now}}

 

But {{#changelog.issue.Sprint.startDate.last.jiraDate}}{{fromString|EMPTY}}{{/}}  return nothing... How could I get sprint startDay via change log?

Camon Jie November 20, 2023

Working: {{#changelog.Sprint}}{{fromString|EMPTY}}{{/}}

Not working: {{#changelog.Sprint.startDate}}{{fromString|EMPTY}}{{/}}

So maybe I have to make “{{#changelog.Sprint}}{{fromString|EMPTY}}{{/}}” as a parameter and find a founction which can insert sprint name and return Sprint state/startDate...

Can anyone help with this...

Suggest an answer

Log in or Sign up to answer