Forums

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

Compare value of 2 fields of the issue to validate a transition

Gregory BENARD November 23, 2023

Hello, during a transition I would like to be able to test that 2 fields in the issue containing a user name are not identical. I did not find in the possibilities proposed in the conditions, validators or post functions. 

I found a possibility to check a constant value for a field but not a comparaison between two fields values of the current issue like it's possible with the IF object in a rule for example.

What I want to do : 

Jira001.png

Thanks a lot per advance for your help.

2 answers

2 accepted

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

Hi @Gregory BENARD 

This isn't possible using native Workflow functionality; you're going to need an App to do this type of comparison - some options include...

---

You could use Automation as an alternative? You could...

  • Create a custom field - eg. a checkbox field called "Users Match?"
  • Populate it using Automation; the rule could activate when either Code Reviewer or Developer is updated, check if they match - and update the field to "Yes" if they do
  • Use the "Users Match?" field in your validator instead, which would be possible without an App

Let us know if this sounds of interest; happy to provide more detailed setup instructions if needed :)

Ste

Gregory BENARD November 23, 2023

Thanks a lot Stephen. I will first try to use the automation because I already use some rules in my project. Have a nice day.

Like Ste Wright likes this
Ste Wright
Community Champion
November 24, 2023

No worries!

If you need any assistance with the Automation Rule, just let us know :)

Ste

0 votes
Answer accepted
Ryan M
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 23, 2023

Hey Gregory - A couple options come to mind off the top of my head.

  1. There are third party apps, like ScriptRunner for example, where you can create Scripted fields and be used to check to values of the two other fields and populate a boolean (true/false) output for that field based on that comparison - you could then use the value of that custom scripted field with the standard transition tools. This would have the benefit of not using up any automation runs.
  2. You could automate the population of a custom boolean field every time a ticket is edited/created using the built in Jira Automation platform. Benefits - it's included with Jira, downfalls could be potentially using a lot of rule runs/performance depending on how this gets used. 

I also see that you're using a condition for this transition. You may already be aware, but just to confirm, a condition would evaluate the condition during page load (before the transition) and HIDE the transition if it is not met already, potentially confusing end users. This would not technically check "during a transition" as you said you were attempting above, but instead prevent the transition from being possible at all - people would not see the option to use that transition at all, and would not be provided any info on why the transition wasn't there. 

A validator would run during the transitions execution and produce an error if the validation isn't passed. Personally I think a validator makes more sense most of the time, but that's up to you to decide what's right for your org. 

Hope this helps or gets the wheels turning towards a solution!

Gregory BENARD November 24, 2023

Thanks for all these very interesting informations Ryan. I just start to use options in transition and your precisions are very helpful. Have a nice day.

Suggest an answer

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

Atlassian Community Events