Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Scriptrunner script to Append Description with contents of custom text field

Hi

 

I've Googled all over and the closest I've gotten is

 

package UpdateIssue
 
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.MutableIssue
 
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
 
issue.setDescription(customFieldManager.getCustomFieldObjectByName("Affected Users").getValue(issue).toString() + "/" + customFieldManager.getCustomFieldObjectByName("Implementation Details").getValue(issue).toString())

 

However this replaces the Description text instead of adding to it.

I'm trying to add some custom field contents to the Description on a post function, so that when the Jira Service Desk approver email is sent to an approver, it includes all of the details in the Change Request.

 

I essentially want:

-----------------

Original Text in the description

 

Name of Custom field 1:

Contents of custom field 1

 

Name of custom field 2:

Contents of custom field 2

------------------

and so on.

1 answer

0 votes
Tarun Sapra Community Leader Jan 14, 2019

Hello @Stephen Letch

Why don't you first save the current description in a variable using

def description = issue.description

and then in issue.setDescription you can append the custom field values to the above variable "description" which is holding the current value of description.

Can you provide an example? I'm not a coder so am having to pull examples from where I can to make this work.

 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

452 views 19 23
Read article

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