"@Adam Bob - ABC-123 is blocking this ticket and has been open for 90+ days"
Hi @Timi Falusi
First thing, what do you mean by "has been open for 90+ days"? For example, perhaps work items which are in progress that long?
If you started with the blocked items, ignoring the parent, you could use JQL to find them:
project = myProject
AND workItemLinkType = blocks
AND statusCategory = "In Progress"
AND NOT status CHANGED AFTER -90d
ORDER BY Key ASC
A check to only note items with an Assignee and Parent work item could be added to the JQL, as needed.
If this was used with the Lookup Work Items action, the distinct parent's could be found, and then a single comment with mentions added to it for the linked, blocking work items and their assignees using an advanced branch over the parent keys.
Kind regards,
Bill
I want the automation to get the assignee of open issues that are currently blocking some other open, non‑task/non‑story issue in one of the IM projects that have been open longer than 90 days.
This in Jira Scirpt runner gets all the blockers;
issuefunction in linkedIssuesOf("project in (USIM, FXIM, CAIM, USFIM, IM, EUIM, AUIM) and issuetype not in (task, story) and status != closed", "is blocked by") AND status not in (closed, resolved) ORDER BY created ASC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill is helping you already with a specific rule approach, so let's stay with that thread for now. I will add suggestions to that one as needed. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Timi Falusi
Yes, and Yes.
If you can formulate a JQL statement that would retrieve the desired issues you can use that in a rule.
You can use the linkedWorkItems() JQL function.
https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedWorkItems--
The exact structure of the rule would take some additional exploration of your use case, as you want to look for Epics that meet your criteria, but also pull data from a subset of issues linked to those Epics.
And, it is possible to mention a user in a comment. You may have to take some extra steps to get the assignee of the linked issue.
A question I would have for you is how will you know that the blocked issue has been open for 90+ days specifically because of the blocking issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't need to know if it's because of the blocking issue.
In Jira Scirpt runner;
issuefunction in linkedIssuesOf("project in (USIM, FXIM, CAIM, USFIM, IM, EUIM, AUIM) and issuetype not in (task, story) and status != closed", "is blocked by") AND status not in (closed, resolved) ORDER BY created ASC
It shows me all open issues that are currently blocking some other open, non‑task/non‑story issue in one of the IM projects sorted from oldest to newest.
So, I want for the open issues in one of the IM projects for the ones older than 90 days for automation to mention/tag the blocker's assignee in the comment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the range on the number of issues you are getting from that filter?
Does this concern Jira Cloud or Jira Data Center?
A general rule structure that might work would be as follows:
TRIGGER: Scheduled
-- Run a JQL
-- Provide the JQL you have
-- Uncheck the box that says get only issues that have changed since the last rule execution
FOR EACH: Related Issue/JQL
(iterates over the list of issues from the trigger
getting the list of IM project issues it blocks)
-- JQL: issueFunction in linkedIssuesOf("key={{issue.key}}", "blocks") and
project in (USIM, FXIM, CAIM, USFIM, IM, EUIM, AUIM) and
issuetype not in (task, story) and
status != close and
created < (-90d)
-- ACTION: Comment Issue
Content: [~accountId:{{triggerIssue.assignee}}] - {{triggerIssue.key}} is blocking this ticket and has been open for 90+ days
The caveat here is that there a limitations on the number of issues that can be retrieved with a JQL and the number of issues overall, including through branching) that can be processed within a rule.
Also, there may be differences in functionality within Automation Rules between Jira Cloud and Jira Data Center
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It gets 123 issues.
I'm not sure if it concerns Jira Cloud or Jira Data Center, how do I know?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding knowing if you are on DC vs. Cloud:
Near your avatar in the upper right click on the Help button and then the About Jira option.
The pop-up will show you information about the Jira app.
If you see that it shows a version number in the format #.#.#, like 9.23.5, then you are on Jira Data Center and please tell us what the version number is.
A Jira Cloud instance will show something more like this for About Jira:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm on Jira Cloud instance. Where would I put the automation if I want it to work across all projects?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are working in Jira Cloud then my solution will need some adjustments.
There is a limitation in Jira Cloud that you cannot use ScriptRunner functions directly in the native JQL fields. ScriptRunner-based filters have to be created and saved in the Enhanced Search screen and then can be referenced by ID in the native JQL filters.
You can do that for the first filter that is finding all the issues that are blocking the IM issues.
In the For Each branch, though, we need to insert a variable. We have to be able to add the JQL syntax directly to the rule for that. So we can't use the issueFunction in linkedIssuesOf() functionality. Instead we need to use the native functionality
issue in linkedIssues("{{triggerIssue.key}}","blocks")
Because this rule is referencing multiple projects it will have to be added through Jira Admin Settings > System > Global Automations. Only a Jira Application Admin can create rules there.
The Scope will need to be set either to Global or to Multiple Projects with all the projects that may contain issues (the IM projects and the projects that contain the blocking issues) are listed.
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.