It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA Service Desk - Copy Value of Organizations to Custom Field Edited

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

1 vote
Answer accepted

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.

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.

Hey Andrew - 

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

@Andrew SweetenHi 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?

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? 

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

Like Jesper Mandrup Keld likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Service Desk

Tell us how you've implemented Change Management

Hello Community 👋, I'm a product manager at Atlassian, looking at improving change management capabilities across our products. In particular, we're looking at bridging the gap between Dev & ...

299 views 0 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you