Automation for Jira - condition when value change on custom field from specific value to another

Yuval Zaltz April 9, 2024

Using Automation for Jira version 9.0.3 on Jira Data Center 9.12 

I want to set a field value if a value changes on another field (single select custom field)  

from one specific value to another specific value.

Can this be done with Automation for jira?

2 answers

1 accepted

2 votes
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2024

Hi @Yuval Zaltz 

You can do this using the "Advanced Compare Condition"

For example...

  • I have a field, called Field 1
  • It has options A, B, C and D
  • The rule should activate if the field is modified from B > D
  • If this happens, edit Field 2

---

Rule would look something like this...

  • Trigger: Field value changed
    • Fields to monitor = Field 1
  • Condition: Advanced compare condition
    • Field value = {{#changelog.Field 1}}{{fromString}}{{/}}
    • Condition = equals
    • Second value = B
  • Condition: Advanced compare condition
    • Field value = {{#changelog.Field 1}}{{toString}}{{/}}
    • Condition = equals
    • Second value = D
  • Action: Edit Issue
    • Field = Field 2
      • Value = <value here>

---

The rule is comparing what happened to the field via the change log - i.e what the value was before the rule was triggered, and what it is now.

Let us know if this works for you :)

Ste

Yuval Zaltz April 9, 2024

Hi Sta and thanks for the prompt response and quick solution.
was able to implement with a minor change in what you wrote:

  • Trigger: Field value changed
    • Fields to monitor = Field 1
  • Condition: Advanced compare condition
    • Field value = {{#changelog.Field 1}}{{fromString}}{{/Field 1}}
    • Condition = equals
    • Second value = B
  • Condition: Advanced compare condition
    • Field value = {{#changelog.Field 1}}{{toString}}{{/Field 1}}
    • Condition = equals
    • Second value = D
  • Action: Edit Issue
    • Field = Field 2
      • Value = <value here>
0 votes
Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2024

Hi @Yuval Zaltz ,

Yes, you can. try this sample process in automation:

When: Field value changed - select the field that will trigger the automation (your single select custom field)

Condition: If/Else block - add condition - Issue field condition - select the field - equals - value - Then: Edit field - select the field you want to update.

Add Else block - do the same (condition then edit field)

Add Else block - do the same (condition then edit field)

so on and so forth.

Hope it helps!

Yuval Zaltz April 9, 2024

Thanks

Dexter de Vera
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2024

Use smart value condition instead of issue field condition.

add smart value condition in if - {{fieldChange.fromString}}  = A

and issue field condition - X  = D

This will check if the value of X is A before changing  to D

Then you may apply the same depending on the "from" and "to" you want to check

If X = from A and X= D

Else if: X=from B and X = D

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.4
TAGS
AUG Leaders

Atlassian Community Events