Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation

Don Hames
Contributor
December 12, 2022

I am new to Jira Automation, so this is probably a simple question that I need help with. I am trying to create a series of Jira issues after a manual trigger. I need to create an Epic and several Stories as children of the Epic. In my testing, I have not found a way to successfully create the Epic and a Story that is a child of the Epic. I can create both issues, but the parent link relationship is not being set. Any wisdom or suggestions?

 

Thank you in advance for your help!

2 answers

2 accepted

0 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
December 12, 2022

Hi @Don Hames 

Use the following rule. This worked for me on my instance:

create epic with story.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2022

Hi @Don Hames 

Yes, and...to Alex's answer:

As you want to add multiple stories linked to the issue, when setting the epic link within the branch please use {{issue.key}} as that will refer to the epic in the branch.

If you instead use {{createdIssue.key}} that will refer to the last issue created, and so the second story added will attempt to refer to the first one, and so on, leading to errors.

Kind regards,
Bill

Like # people like this
Alex Koxaras -Relational-
Community Champion
December 12, 2022

@Bill Sheboy thanx for this correction!

Like # people like this
Don Hames
Contributor
December 12, 2022

Thank you, @Bill Sheboy and @Alex Koxaras -Relational- Your suggestion worked the first time, and I can now create multiple Stories in my Epic. This is just what I needed, and thank you for such a quick response.

 

Just one last question on the same subject, I need to create the Stories in a separate project from my Epic. It's working only because I enter the other project's name on the Create Issue:

Can the destination project name be overwritten with the More Options JSON script? 

Create Issue.png

Like kiseldimas7 likes this
Alex Koxaras -Relational-
Community Champion
December 12, 2022

I would expect to use a smart value on the project placeholder, rather that JSON of the below field. Project and summary (and reporter) are the required field to create any issue on Jira. What exactly is the business requirement?

Like kiseldimas7 likes this
Don Hames
Contributor
December 12, 2022

@Alex Koxaras -Relational-  I have a master project with all the master records in hierarchal order. The lowest level issue specifies what Epics and Stories I need to create. I am putting the Epics in the same master project, but the Stories need to be created in the team project that will be doing the work. When I use the Create Issue action, it has a dropdown list of what project I want to create the issues in. I need to be able to take the project name from the master record in the main project and use it to specify the target project where the stories are the be created.

I don't see a way to turn off the project dropdown on the Create Issue action.

create issue 2.png

Like kiseldimas7 likes this
Alex Koxaras -Relational-
Community Champion
December 12, 2022

How is that master record defined in the main project?
I mean you create an epic in the master project. That's fine. But when you create the stories, where is the field that defines the project that should be placed?

Don Hames
Contributor
December 12, 2022

It is a field in the main project and is a Project Picker (single project) control. So the information is there. I don't know how to create an issue and use the field to specify the target project:

project picker.png

Alex Koxaras -Relational-
Community Champion
December 12, 2022

On the create project field, enter the following smart value:

{{issue.product jira project.id}}

create project id.png

The only thing you have to make sure, is that the destination project has the specific issue type you are trying to create. E.g. if you are trying to create a story, then your destination project's issue type scheme, must include the story issue type. 

Don Hames
Contributor
December 12, 2022

@Alex Koxaras -Relational-  I have tried every possible option, but the Epic is created, but the stories are not. The audit log says there was a JSON issue. I tried the following for the Create Issue project:

{{iissue.product jira project.id}}

{{issue.productjiraproject.id}}

{{triggerissue.product jira project.id}}

{{triggerissue.productjiraproject.id}}

{{issue.product jira project.id.as.JsonString}}

 

None of these work.

Like kiseldimas7 likes this
Alex Koxaras -Relational-
Community Champion
December 12, 2022

@Don Hames most likely you have opened the "additional fields". Try to close them and try again.

0 votes
Answer accepted
Jack Brickey
Community Champion
December 12, 2022

Hi @Don Hames ,

How are you dealing with giving the epic a name in your automation? Are you somehow using smart values. Understanding this will help define the best course of action for your automation rule. If you have a rule that you have created as a starting point please share via a screenshot.

Suggest an answer

Log in or Sign up to answer