I would like to create an automation that close an initiative when all parent epics are closed.
Hello @Sabina Tangaro
Welcome to the Atlassian community.
Can you provide a screen image of an Initiative item showing the related "parent Epics"? Are the "parent Epics" child items under the initiative?
Are the Initiative and related parent Epics all in the same project?
What is your level of access in Jira? Are you a Project Administrator, or a Jira Product Administrator?
Are you familiar with building Automation Rules? If so, what have you tried so far for building this rule? Please share screen images with us and explain what problems you are facing.
Hi, yes I refer to Epics child items under initiative, and Epics and initiative are all in the same project. I'm project Administrator.
I've already created more automation rules like complete an epic when all related user stories are completed. Here is a screenshot:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the additional information.
Is that rule image from the same system where you want to create your new rule? If so, based on the icons in it this concerns a Jira Server or Jira Data Center system, not a Jira Cloud system as indicated by the Deployment tag for your post.
Are the Initiative and related parent Epics all in the same project?
The screen image you provided appears to be a rule for updating the parents of Epics based on the change of the Status field of the Epic. If Initiatives are parent issues for Epics it seems like this rule would apply, if the pictured rule is on the target Jira instance.
Is this rule not working? If the rule is not working, describe how it is not working. Are you transitioning an Epic to Completed? Is the rule getting triggered? What is the output in the Audit Log when the rule executes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, you are right we are working on Jira Data Center system.
All Initiative and Epics belong to the same project.
My purpose is to create a rule that set an initiative to completed status as all its child epics are set to completed status, in particular when the last child issue (epic) status transit to completed.
Here is a hierarchy:
I changed the epic "PROPRO-55" status from progress to completed, but the initiative "PROPRO-53" did not change its status from progress to completed.
Could you please help me on it?
BR Sabina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information. That is very helpful.
First the "some errors" status of the rule is referring to the problem with the Send email action having no value for the To field.
Second, by using the parentIssuesOf() function you are getting both the direct parent and the grandparent of the Epic. I think you don't want the grandparent, do you? So you might want to add a Condition within that branch to check that the issue you are working on in the branch is an Initiative. Since the rule is trying to process both the parent and grandparent through the branch I'm having a little trouble deciphering the audit log entries.
Can you update the branch with the Condition I suggested and try the actions to run the rule again, and share the output?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, I've changed the branch as you suggested, but there is a missing condition, all epics must be in completed status. So my question is: is there a way to bind the initiative status transition when all its child epics are completed?
Following the new automation and related audit log:
BR Sabina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You removed this condition from within your branch. That was not part of my suggestion. Add it back in and the try executing the rule again.
An alternative phrasing for the JQL would be
"Parent Link" = "{{issue.key}}"
Within the branch {{issue}} references the issue to which you have branched - the parent of the trigger issue. At that moment {{issue.key} and the Parent Link field in the trigger issue are the same value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, we have tried this automation but we have the reported error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post the details of your JQL issues match step. The error is indicating that you have entered an improper JQL statement there.
I think what you have entered has at the beginning
issues:
That would not be valid JQL. You need to remove that from the JQL statement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you suggesting to change the JQL in this one?
"parent link"={{issue.key}} and status=completed
Also in this way it doen't work.
I remind you what is our purpose. We want to create an automatism that transit an Initiative into Completed Status as soon as the last of its Child Epics transits in Completed status.
We are thinking to configure the following steps:
1) trigger the automatism whan an Epic in our project transit to completed
2) find the Parent Initiative of the triggering Epic
3) check if all the Epics child of Initiative at step 2 are in Completed Status
4) if all the Child Epics are in Completed status, transit also the Parent Initiative in Completed status
In this moment we are blocked at Step 3, and we are asking for support to configure steps 3 and 4.
Have you got any suggestions about step 3 and 4? Or have you got any alternative solution to suggest us in order to reach our purpose?
Thanks in advance for your kind support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on the last image you posted, this was the condition I was talking about.
Before this last change you made, it looked like this
With your update you changed {triggerIssue.customfield_11}} to {{issue.key}}. Revert that specific portion to what you had before the change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made this change, but something doesn't work (see message error 4 in picture "Automation 3" attached). It seems like the smart value {{triggerIssue.customfield_11}} does not return the expected result.
Anyway I don't understant the logic. If I look at the message error 4, it seems that if I use a condition inside the violet branch "For JWL" all the following conditions are linked with an AND operator (see error 4 related to the last condition).
In this scenario I don't see how I can extract the list of Epics child of a given Initiative if the JQL I use includes the condition Key= Parent Initiative Key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rule is not getting any sort of value from {{triggerIssue.customfield_11}}, so there is no value being substituted into the JQL. You can see this in the error message. Notice that there is no value where the value from {{triggerIssue.customfield_11}} should be. So the JQL statement is invalid.
Where did you get the information that the Parent of the child issue is stored in the field referenced by "customfield_11"?
I assumed that you were intentionally obscuring the real custom field ID with that data.
If you don't have the correct field specified there, then the JQL will not work.
One way to find the correct field name is:
1. Make note of an Epic issue key where that Epic is the child of an Initiative.
2. Open a browser tab and plugin the following URL. Substitute the base URL for your instance and the issue key for the Epic.
https://baseURL/rest/api/2/issue/issueKey
That will output all the fields and their values for the specified Epic. Search through that output for the issue key of the Epic's parent Initiative. That will appear with the field name it is stored in near it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.