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

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

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 Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

50 views 0 3
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot