Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set summary before create using Scriptrunner postfunction

JensH
Contributor
November 22, 2024

Hi

I need to set the summary field with a default value that is shown in the create screen such that users does not have to enter anything to the field.

To this end i have create a post function on the create transition:
Screenshot 2024-11-22 at 09.32.38.png

and it looks as:
Screenshot 2024-11-22 at 09.36.39.png

I have tried a few different conditions, im not really sure what it should be. For the code it self, i think from the example code that i can use issue directly.

The post function does not run:
Screenshot 2024-11-22 at 09.39.32.png

I would expect it to run every time i Create a tilbud issue. Can any one help me to understand it is that im doing incorrectly here.

Thanks 
Jens

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
3 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 22, 2024

Hi JensH,

I would advise using the Behaviours feature provided by ScriptRunner for Jira Cloud to set the summary on the create screen. 

This feature would allow you to set the value of the Summary field every time an issue is created so the user does not have to fill in this field.

A script to do this would look something like the script below.

Set Summary Behaviours
const summaryValue = "A demo summary";

getFieldById("summary").setValue(summaryValue);

Please note that currently, Behaviours only works on Jira Software company-managed projects, as documented here.

A post function as you have tried will not set any values on the Create screen and will only set values after the issue has been created.

I hope this information helps.

Regards,

Kristian

JensH
Contributor
November 24, 2024

Hi Kristian

Thanks for the answer. Works perfectly.

Kind regards
Jens

 

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events