Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

×
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

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
AUG Leaders

Atlassian Community Events