Forums

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

Script Runner - create sub-task automatically post function - set default Descrption

Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

Hi Team,

In my project workflow for a Transition I added a Post-function to create a sub-task automatically and I selected the 3 fields to copy the values from Parent issue

When i Execute the workflow Transition its creating a subtask automatically  and copying the values  from Parent issue.

So, here I need When its Creating subtask automatically i need to set a Default value for "Description" field.

Can you please suggest me how to achieve this

 

Thanks,

Kumar

1 answer

1 accepted

2 votes
Answer accepted
Tarun Sapra
Community Champion
February 19, 2019

Hello @Kumar 

In the "Additional Actions" section of the create sub-task post-function you can set the default description

issue.description = 'default description'
Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

@Tarun Sapra  Thanks for your quick response

Here is the default value  for description I need to set like

Description
________________________________________________

DateTime:

Cause:

Action:

 

This is the value i need to set can you please help me here in the 'defalut description' i replased the above vale its says error

 

Thansk,

Kumar



Tarun Sapra
Community Champion
February 19, 2019

Hello @Kumar 

Based on your requirement I suggest you to use the behaviour module of SR plugin which get's activated at the time of create issue screen popup

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

@Tarun Sapra  Thanks for your reply 

I tried the Behaviour script but its not working while its creating sub-task automatic

after creating when i click on Edit and Update the subtask then its working.

 

Thanks,

Kumar

Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

Hi @Tarun Sapra  I resolved it I did a small change in the script

issue.description = """ Description
________________________________________________

DateTime

Cause

Action""".replaceAll(/ /, '') 

 

This is the script i have modified and its working thanks for your help 

 

Thanks,

Kumar

Lars Swart
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2021

Hi, does anybody now how to add bullet points to the value? description is a rich text field, so there must be a way to include formatting elements.

Suggest an answer

Log in or Sign up to answer