JIRA Service Desk - Copy Value of Organizations to Custom Field

MAG-II May 17, 2018

Hello - 

I am having a problem copying the (system) JIRA Service Desk Field Organizations to a (text box) custom field. I am using a post function Copy Field Value via the JMWE add on that allows me to do this with any other fields. 

It seems as though Organizations has a different kind of value than the name I gave it. What I am trying to do is copy the Organizations value "Admin" to the custom field "IT Organization." You can see via the screenshot that the value "4" gets copied to IT Organization."

Is there any kind of work around in order to get what I actually named Organizations (Admin) copied onto a custom field?

 

Organizations.PNG

1 answer

1 accepted

3 votes
Answer accepted
ASweeten
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2018

Hi Michael,

You should be able to achieve this by using the 'Set field value (JMWE add-on)' post function.  This allows you to set the value of your new custom field using a Groovy expression.  

  1. Select your custom field, 'IT Organization', in the dropbox labeled 'Field'
  2. Change the 'Value type:' dropbox to 'Groovy Expression'
  3. Enter 'issue.get("Organizations")*.name' in the text area
  4. Click 'Add'

The output in your IT Organization field should reflect the Organizations name now, rather than the ID.

MAG-II May 22, 2018

Hi Andrew - 

Thanks for the response. My question regarding your solution - will this allow me to actually copy the Organizations field (which is set when Issue gets created) to the IT Organizations field?

I'll give it a shot.

MAG-II May 22, 2018

Hey Andrew - 

That totally worked. Thank you so much for your help!

David May 28, 2019

@ASweetenHi Andrew, is it possible to get the value of the Organization name without brackets in the value?

If I use issue.get("Organizations")*.name it returns with: [some company name] in brackets like that. Anyway to get this without the brackets? Or remove the brackets somehow?

Jesper Mandrup Keld September 26, 2019

I also get the brackets "[Organization]" around my extract when using issue.get("Organizations")*.name i also tried issue.get("Organizations")?.name but i actually don't know the difference. Can some one assist? 

David September 27, 2019

Here you go:
(issue.get("Organizations")*.name).join(', ')

Like Jesper Mandrup Keld likes this
Jesper Mandrup Keld September 27, 2019

Thanks @David 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events