Want to create sub-tasks based on Component/s Value

We have a requirement where we have to create sub-tasks when Component/s field value is 'XYZ'. I am not able to find anything in post functions or script runner.

2 answers

1 accepted

This widget could not be displayed.
Vasiliy Zverev Community Champion Oct 17, 2016

Try this:

  1. add post-function
  2. Script post-function
  3. Create a sub-task

In condition 

import com.atlassian.jira.bc.project.component.ProjectComponent
import com.atlassian.jira.component.ComponentAccessor

for(ProjectComponent projectComponent: issue.getComponentObjects()){
    if(projectComponent.getName().equals("xyz"))
        return true
}
return false
This widget could not be displayed.

You can use the Create on Transition for JIRA plugin you can easily create issue and also sub-tasks, if you are planning to use the add-on I can help you with the post function, I am already using the add-on for the same functionality that you are asking for.

Hi @Bharath Kumar9Bharath Kumar,

Could you please me on the below requirement?

My requirement is that I would need the below option added under the program management in JIRA. Design Change/Update.
For the above option, below should be the checklist criteria
1. If the change is for Program Level, Program/Multi-tenant name is mandatory and it should automatically provide an option to select whether there any fee changes required for this change. If yes for fee change, there should be a .xlsx attachment mandatory.

Upon creating the ticket it should automatically link the ticket as sub-task to the Program or Multi-tenant Main ticket.

2. If the design code change is for a Particular BP, BP ID(Custom Field) is mandatory and it should automatically provide an option to select whether there any fee changes required for this change.
If yes for fee change, there should be a .xlsx attachment mandatory.

Upon creating the ticket it should automatically link the ticket as sub-task to the BP’s Main ticket based on bp id.

For this Requirement, i have done the below changes in my Test Environment:

As per the client requirement, i have made the changes below:
I have created new Issue Type “Design Change/Update” and created the fields “BP ID, Fee Values, Program Name”. As requested I have mandatory the fields also I have created the one more field called Fee Changes Required with options “Yes/No” We can’t mandatory the attachment field because it’s a Default. So I have updated the comments under Fee Changes Required field that If fee change is required then they will select the option YES and attach the .xlsx file.Requiremet.PNG

But here my questions is – 
As per the requirement - Upon creating the issue, it should automatically link the ticket as sub-task to the BP’s parent issue based on bp id (Custom Field ID).
Here BP ID is Field.
Is this possible???

Please help me on this.................

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

111 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you