Forums

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

How can I create a field changed check from one value to another in Automation Rules?

Talles Silva November 23, 2023

Hello community!

I'm trying to create a new rule on our account to do the following check:
- When the Priority field is updated, I want the automation to check which Priority was previously defined and which Priority was defined;
- After checking the new Priority, I want to modify the date of a custom field that we have (deadline) based on the date that was previously defined.

I still don't understand how I can do these checks in Jira Software.

 

1 answer

1 accepted

0 votes
Answer accepted
Ste Wright
Community Champion
November 23, 2023

Hi @Talles Silva 

This should be possible, but can I confirm the logic for this rule:

  • How does the Priority check relate to the date?
  • What logic defines the date set?

An example (and/or the current rule you've built) would be beneficial here :)

Ste

Talles Silva November 23, 2023

Hi, @Inactive Stephen

If the initial Priority was URGENT, we set a deadline date; when the Priority is changed from URGENT to HIGH, for example, we want to set another date for the deadline (using the previous deadline date + the rule we defined for the new deadline).

Talles

Ste Wright
Community Champion
November 23, 2023

Hi @Talles Silva 

I'd recommend using variables for this - and then IF/ELSE conditions to set the date.

The rule might look like this...

  • Trigger: Field Value Changed
    • Fields to Monitor = Priority
  • (1) Action: Create Variable
    • Name = PreviousPriority
    • Smart Value = {{changelog.priority.fromstring}}
  • (2) Action: Create Variable
    • Name = CurrentPriority
    • Smart Value = {{changelog.priority.tostring}}
  • (3) Action: Create Variable
    • Name = DeadlineDate
    • Smart Value = {{issue.Deadline Date}}
  • Condition: IF Block...
    • IF...
      • All Conditions Match:
        • Condition 1: Advanced Compare Condition
          • First Value = {{PreviousPriority}}
          • Condition = equals
          • Second Value = Urgent
        • Condition 1: Advanced Compare Condition
          • First Value = {{CurrentPriority}}
          • Condition = equals
          • Second Value = High
      • Action: Edit Issue
        • Field = Deadline Date
          • Value = {{DeadlineDate.toDate.plusBusinessDays(3)}}
    • ELSE-IF...
      • ...etc

---

A few notes on this rule...

  • Variables (1) and (2) are the previous Priority value (whose change triggered this rule), and the current value. You could also use {{issue.priority}} for (2)
  • Variable (3) is the current Deadline Date
  • The IF Block then checks what the previous and current value for Priority was - before setting the deadline date dynamically
  • The Deadline Date Action is just an example - check out other options for date smart values on this help page
  • ELSE-IF onwards would be a repeat of IF, with different comparable Conditions

---

Let us know if this works for you!

Ste

Talles Silva November 27, 2023

Hi, @Ste Wright !

Thank you very much! Helped me a lot!

 

-- 

Talles

Like Ste Wright likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events