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

Auto populated parent issue id to description field of Sub:task

Edited

Autopopulate the parent issue ID to  Sub:Task Description field during the creation of the Sub:Task  issue type and the auto poulated description should be "See parent ticket xxx-1234" and parent id should have a hyperlink. Please help me how to achieve this.

At below i'm attaching the screen shot where i entered manually.

parent id.png

Note- we are using scriptrunner in our organization.

 

Thanks,

Siva.

2 answers

1 accepted

2 votes
Answer accepted

Hi @siva  Apply Custom script post-function on subtask workflow to display parent issue key in Subtask description field.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.UpdateIssueRequest
//import com.atlassian.jira.config.properties.APKeys

//def baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)

issue.setDescription("${issue?.getParentObject()?.getKey()} is the parent issue key")

 Hope it works for you!

Thanks

V.Y

@Vikrant Yadav 

Thanks for the reply and the above mension script works thank you very much for your help.

Thanks,

Siva

Like Vikrant Yadav likes this

@siva Cool! Glad to hear it works for you!

Thank You

V.Y

0 votes

Hi @siva

You will need to use a post function that overwrites the description with the parent's key. 

Here are the details: https://library.adaptavist.com/entity/copy-field-value-from-parent-issue-to-sub-task-upon-creation

Regards 

Hi @Fabian Lim 

Thanks for the early reply gone throw the script but actually i'm new to the scriptrunner so, i'm bit confused can you please paste the modified script code that shows  parent issue key ID  in description field in Sub:Task 

Example : See parent ticket Siva-1234     here Siva-1234 is parent issue key ID 

Thanks for the help truely appreciated 

 

Regards,

Siva

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

871 views 25 28
Read article

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