Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,636
Community Members
 
Community Events
185
Community Groups

If statement comparing same field type's values from two different issue types?

I have two different issue types, both sharing the same field (lets say "labels"). What I want is in JIRA automation, to have a rule where if a label is added in IssueType1, that it will check if that label value/content exists in an issue under IssueType2, and then take action if true.

Basically comparing the values of two of the same custom field, but in two different issue types. I know you can pull the contents of the field in JQL through {{issue.field name}}, but I wasn't sure how to use syntax to compare the same field name to itself, but for different issue types. If this is possible, I would assume if you had multiple labels to compare, you could change it from an equals to a contains statement?

Thanks!

1 answer

0 votes
Mark Chaimungkalanont
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 24, 2021

Hey there Kyle!

I guess a semantic thing to note is that fields are added to specific issues and not issue types so that might help a little.

So the use case here is if an label = "database" is added to an issue with type Bug, you want to check if the label "database" exists as a label for any "Improvement" issue?

It's a little tricky but you can:

  1. Trigger on labels changed
  2. Use the "lookup issues" action to look up if there're any other matching labels of the different issue type: something like: labels = "{{triggerIssue.labels}}" AND issuetype = Improvement
  3. Then use an advanced condition to make sure that the count is = 0 (label is new) or otherwise

Hope that helps!

Cheers,

Mark C

Thanks for the help! Unfortunately this would be on the server version of JIRA, and to my knowledge, the "lookup issues" action is currently only available in JIRA cloud, not server :/

Update - I got it to work to an extent using if else statements in JQL through JIRA automation, however it does NOT work properly if you have multiple tag values under labels, as it interprets those as spaces when comparing. The solution seems that it would work using the advanced compare condition using the contains method, so something like

If 

{{issue.labels}} // (for issue type 2)

CONTAINS

{{triggerIssue.labels}} // (for issue type 1)

Then

Execute action

 

What might be happening is that using {{issue.labels}} is also selecting the trigger issue type. I have a "For" statement preceding that selects Issue Type 2 before that If statement though. 

 

Is it possible to do something like {{issue.<issuetypename>.<field>}} ?

Like {{issue.Type2.labels}} ?

@Kyle Lefton did you ever find a full answer to this? I have had a similar issue. i have used zapir to bring epics and stories in to Jira and I now want to find a way to link the stories to the epics the stories have customer field that the same as the epic name.  but I can find a way of creating the right trigger 

Like dD likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events