Forums

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

copy custom field content, how to handle different field types (assignee/timestamp/multiline text)?

Alexander Herz April 25, 2025

I have 2 jira issues that are known to have the same custom fields with names c1,c2,c3.

I have some js code on post work step automation that can copy the value from the source issue's c1 to the target issue's c1, but that only works for multiline text by reading from/writing to the "content" property inside the json structure associated with both fields/issues.

If c2 is not a multiline text but an assignee field or a time stamp then the code will fail to copy the value, as the property "content" does not exist in the custom field, instead I guess the "displayName" would need to be copied for the assignee and the "value" for a select field.

So I know that each c1/c2/c3 respectively are of the same kind in both source and target issue but I do not know what kind they are nor what property to copy. Is there some way to generalize this or do I need to check the kind of each ci and then derive the "right" properties to copy from it?

Thx,

Alex

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events