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

siva December 9, 2021

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
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2021

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

siva December 13, 2021

@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
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 13, 2021

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

Thank You

V.Y

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2021

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 

siva December 9, 2021

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