How to pull in Parent/Epic value when a bug is linked to an issue as "Blocks"

Lissa Meade May 21, 2021

We use a Celigo integration to create time entries in NetSuite from work logs in Jira via a custom field containing a NetSuite task ID within an epic; when work is logged on an issue associated to that epic it gets picked up by the integration and sent to NetSuite. In order for that to work, all issues must be associated to an epic, which is where things get sticky. 

Next-Gen Jira projects can only have one child issue type, which is used for sub-tasks, which means that Bugs are a standard issue type instead. When a bug needs to be created, the reporter of a bug links the bug to the issue that they were testing, but they almost never attach an epic to the Bug. Then when time is logged on a bug without an epic link it creates an error in Celigo and the time entry is not created in NetSuite.

In order to get around this, I've created an automation rule to look for the parent/epic of the linked issue and apply it to the bug:

When an issue without epic is linked, adopt the parent link from original issue.png

It works great when the link type is "Relates to", but when a bug is linked to an issue as "Blocks" it reverses the direction of the link relationship so that the Bug is the Current Issue instead of the Destination Issue. I can't seem to come up with an automation rule that pulls the parent from the Current issue instead, and I've tried everything I can think of. Jira offers no way to use a smart value to find the issue link. Also, there is something funky with the way next-gen projects use parent vs epic links, and so attempts to do the same rule using the Current Issue as the branch criteria fails with this error: "No fields or field values to edit for issues (could be due to some field values not existing in a given project):"

As a stop-gap measure I had to create a rule that copies all of the issue links from the destination issue over to the bug as the issue link type "Related to", which then runs the original rule and applies the epic link, but it's messy and could easily cause the wrong epic to be linked. I've also considered 

Has anyone else had this issue, or can anyone think of a cleaner solution?

1 answer

0 votes
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.
May 21, 2021

Hi @Lissa Meade 

Have you tried instead checking the linking of "is blocked by" in the trigger?  That would indicate the issue blocked by the bug as the trigger issue.

And, I believe that Team-Managed (next-gen) projects use parent rather than epic link for that relationship.  Take a look at using that to access the epic.

Best regards,

Bill

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.
May 21, 2021

Oops... My bad: you cannot check that in the trigger as the "blocks" and "is blocked by" are tested at once.  Instead you would add an advanced compare condition for the last added link after a generic linked trigger.

checking for is blocked by.PNG

By the way, the method to find the names of the smart values which are not listed on the documentation pages is described here:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Suggest an answer

Log in or Sign up to answer