Is there a way to make it check if 2 fields match before transitioning?

Yousuf Al Rawahi
Contributor
April 14, 2024

Is there a way to make it check if the assignee field matches the 'Staff Name' field (custom field) before transitioning from status to another status? If it matches then it will transition to another status, otherwise it will stay in the same status.

3 answers

1 accepted

0 votes
Answer accepted
Maciej Dudziak _Forgappify_
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.
April 14, 2024

Hi @Yousuf Al Rawahi

In Jira out of the box, it won't be possible. But it should be quite easy using any 3rd party Jira expression-based validator / condition (assuming you are using company managed project)

The expression will depend on the type of your custom field. If it is a User Picker, then it should be straightforward like

issue.assignee.accountId == issue.customfield_xxxxx.accountId

 where xxxxx is the ID of the 'Staff Name' field 

We've developed the Jira Expression Validator as part of the free  Workflow Building Blocks for Jira  app, which can help you in writing such expressions. I would appreciate it if you could give it a try.

Cheers

Yousuf Al Rawahi
Contributor
April 14, 2024

It worked!

Thanks

4 votes
Ste Wright
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 14, 2024

Hi @Yousuf Al Rawahi 

Not natively; you'd need an App to expand the available workflow conditions to restrict a transition based on two fields matching.

Check out Apps on the Marketplace such as...

---

Natively, you might be able to do this via Automation, depending on the logic...

  • If the transition should happen automatically once the fields match, you could do this just using a rule - i.e.
    • Trigger if either field value has changed
    • Check both fields match
    • If they do, transition the issue
  • If the transition is manual, but would rely on the two fields matching, you could...
    • Create a custom Checkbox field - eg. Fields Match? - with one option "Yes"
    • Populate the field using an automation rule...
      • Trigger if either field value has changed
      • Check both fields match
      • If they do, check the box
      • You might need a separate rule to uncheck it if the fields no longer match
    • Set a condition on the workflow - the "Value Field" condition - to check "Fields Match?" equals Yes

---

Let us know if either option is of interest!

If you need any additional help to set either of these up, we'd be happy to help :)

Ste

0 votes
Neel Mohapatra _Appfire_
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.
April 14, 2024

Hi @Yousuf Al Rawahi ,

You can also make use of JMWE with the help of build your own scripted validator 

It could look something like below:

Screenshot 2024-04-15 at 10.58.40 AM.png


You also have the option to add conditions; for example, the two-field comparison should only be made if the assignee is a so-and-so person or if a filed value is something.

you can raise a support ticket with us, if you need any assistance.


Good day!


Suggest an answer

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

Atlassian Community Events