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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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}} ?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

How to log work and track time in Jira when a person is part of multiple teams

  The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...

58 views 2 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you