Forums

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

Comparing multiselect fields between issue and parent of issue

dsaveri December 17, 2024

Title says most of it.. i have a multiselect custom field in the parent and a different multiselect custom field in the issue that triggered the jira automation. Id like basically compare the two... if parent has "A,B and C" and issue only has B and C (and no these are different so there is a mapping that is going on), id then like it to do an action...(append a string to a variable). But cant seem to get a simple if this and this are true do that. The idea would be that there would be multiple conditions and they all have to be true but if there is a better / simplier way of doing this Im all ears.  

1 answer

0 votes
Trudy Claspill
Community Champion
December 17, 2024

Hello @dsaveri 

Welcome to the Atlassian community.

I assume you are trying to do this within an Automation Rule. If do, it will help us advise you about changing your automation rule if you provide us with screen images that show us your entire rule, provide the output of the rule execution from the Audit Log, and tell us how the results did not match your expectations.

If would also help us if you provide some examples scenarios and how they should be handled, with example data.

 

If you are not using an Automation Rule, how are you trying to implement this?

dsaveri December 17, 2024

Yes I am using Automation.  Its a very basic automation as I am just starting out. 

  1. Trigger is when the item goes from a "Not Ready" status to "Ready"
  2. I set a couple variables
  3. Then an "If or Else" and in the If section I am trying to get something combined to what I have working in teams but in a single condition and nothing I have done is working.

I have a teams message that validates that the two If conditions by themselves work:

{{#if(not(issue.parent.fields.customfield_12521.join(",").contains("ABC")))}}mismatch 1{{/}}

{{#if(not(issue.fields.fixVersions.join(",").contains("XYZ")))}}mismatch 2{{/}}

Basically I want to have the below result with both of the fields being multiselect

----customfield_12521---- fixVersions----Status----

----ABC--------------XYZ---------FALSE

----null------------XYZ----------TRUE

----ABC--------------null---------TRUE

----null-------------null---------TRUE

 

As I am doing an audit of the fields, my intention is that once I have this working, Id add other conditionals to the same if else and if any of them are true it would set one of those previously mentioned variable to Fail for the audit. 

Trudy Claspill
Community Champion
December 17, 2024

Thank you for that additional information.

And what is indicating that the rule is not working as you expect it to?

A challenge with using the Create Variable action in rules is that the variable will cease to exist when the context of the rule shifts.

It would be very helpful to us if you could provide screen images that shows the entire rule and then the details of each step. It is hard to diagnose context problems without seeing the actual rule.

Suggest an answer

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

Atlassian Community Events