Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

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

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

1 vote
Answer accepted
Tarun Sapra Community Leader Feb 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'

@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 Leader Feb 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

@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

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

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

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