Forums

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

Copy organization from a customer into a custom field

Torsten Möckel February 18, 2022

Hello all,
I would like to use an automation to copy the organizations from a customer in a custom field. Is there a smart value field for this? Is this possible.

Example:

customer A is in organization xyz

copied

xyz in custom field

2 answers

0 votes
James Carn
Contributor
February 18, 2022

You can actually do this in normal automation - we do the same thing - when the value changes we copy the entry from the organisation field into the log and then write that to the custom field, this has helped with integrating this into other non JSM projects

0 votes
Fabio Racobaldo _Catworkx_
Community Champion
February 18, 2022

Hi @Torsten Möckel ,

you can do that through a scripted post function provided by Script Runner.

Here the scripted pf code :

def cfMyField = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'YOUR_FIELD_NAME_HERE'}
def cfOrganization = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Organizations'}
def cfOrganizationValue = sourceIssue.getCustomFieldValue(cfOrganization)

if (cfOrganizationValue) {
issue.setCustomFieldValue(cfMyField,cfOrganizationValue.first().name.toString())
}

Hope this helps,

Fabio

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events