Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set default value in Custom field on Create transition using Scriptrunner in JIRA Cloud

Digvijay Singh Gehlot
Contributor
November 28, 2024

Hi Community,

I am creating a behavior in Jira Cloud using scriptrunner, where I want to set a default value in Summary and Description fields on Create transition.

Please find the below code:

const summaryField = getFieldById("summary")
summaryField.setValue("Short Description of Release")

const descriptionField = getFieldById("description")
descriptionField.setValue("Long Description of Release")

Please guide if the above code is correct and will it work on Create transition, and let me know if it needs any refinements.

Thanks

1 answer

1 accepted

5 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024 edited

Hi Digvijay,

The code for Summary is correct as Summary takes a string as input but the Description field requires you to provide the description in Atlassian document format.

You can see details of what each field requires in the docs here.

Fior setting the description we have an example in our Script Libray here that you can use as an example to see how to do this.

I hope this information helps.

Regards,

Kristian

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events