Forums

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

Concatenating data options of two fields into a new field

Fiona Lauchlan July 9, 2025

I have 2 multi-select fields set up in my JPD Project. I'd like to auto-populate a third select field which combines the data from both these multi-select fields. Is this possible via automation and custom fields?

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
July 9, 2025

Hi @Fiona Lauchlan 

Yes, that is possible when the values of the source fields match your destination fields.

Have you tried to create the rule yet?

  • If you have and the rule is not working as expected, please post images of the rule, audit log details, and explain what is not working as expected.  Those will provide context for the community to offer suggestions.
  • If not, your rule could merge the values of the source fields into a Created Variable, and then split them back apart into a list, find the distinct values, and finally iterate over them to add to the destination field using a dynamic JSON expression.

Kind regards,
Bill

Fiona Lauchlan July 10, 2025

I have created a new destination field. This is set up as a select type, with no data options.
I am now attempting to create a rule. 
So far I have created a Trigger, for when Value changes on either of the source fields, but any guidance on how to create variable would be appreciated. I attempted to select the two fields from the smart values but receive error in numbers returned
JPEG1.jpgJPEG2.jpg

Bill Sheboy
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.
July 10, 2025

When posting rule images, please post the entire rule in one continuous image and post the relevant actions as separate images.  That will provide overall context for what is happening.

Until we see that...

When creating a rule like this, I recommend writing intermediate results / smart values to the audit log with the Log action to help with debugging the rule.

 

Please re-read my explanation of how to combine the values and the documentation for the Create Variable action.  As you see on the page, the Variable Name is not valid as it contains spaces, and your merge expression is incorrect.

To get the values for one of the multiple-selection fields, use this.  Please replace the ID numbers with your own value.

{{issue.customfield_12345.value.join(",")}}

Do the same for the other field, concatenating the results, with a comma between them.

Then split() them back apart into a list, and finally use the distinct function:

{{issue.customfield_12345.value.join(",").concat(",").concat(issue.customfield_67890.value.join(",")).split(",").distinct.match("(.++)")}}

 

Once you have tried and tested that expression, it may be used to create the dynamic JSON.

Suggest an answer

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

Atlassian Community Events