"Initiative" seems to be the most common issue type above Epic. So let's talk about Epics that are children of Initiatives.
I'm looking for a query (JQL) that will give me just the Initiatives that are parents of the Epics in a given project. For example:
I want a JQL query that will list just IN-123 and IN-124 for project ABC.
A similar JQL query for project QQ should return just IN-124.
So this JQL is solving for "All the initiatives that are parents of Epics in a given project".
The solution needs to NOT specify the exact Epics or Initiatives of interest, but find them dynamically. So, for example, if IN-125 gains a child Epic from the ABC project, the query for the ABC project should now return three Initiatives.
I don't see a way to do this in baseline Jira (Data Center, in my situation). We happen to also have the PowerScripts and ScriptRunner add-ons. But I don't see how either of them can solve this problem either.
A proper solution should be usable by Project Admins. Solutions like the Script Console in ScriptRunner require a Jira Admin, and I'm less interested in those.
Our large organization needs this in order to scope Jira Plan (Advanced Roadmap) configurations to show only the Initiatives that relate to each team/project.
Adaptavist support (the folks who make ScriptRunner) suggests that a likely cause is a conflict in function names between multiple Jira add-ons. Documentation on the topic here.
That seems likely to explain what's going on. I'm offering this partial solution while I wait for our Jira Admins to explore solutions in our instance. It's not clear if the functions in another add-on can be disabled to eliminate the conflict with the ScriptRunner functions I want to use.
I'll update here once things get fully resolved for me.
I mentioned in my OP: "We happen to also have the PowerScripts and ScriptRunner add-ons." This turned out to be a key to the solution.
We did have function name conflicts due to multiple Jira add-ons being installed. A Jira Admin disabled a couple of PowerScript functions, and I can now use the ScriptRunner functions.
Kudos to Adaptavist support for helping us resolve this fairly quickly (although I feel their documentation might have called out this known potential problem more clearly).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have the correct scriptrunner functions enabled you can do this but if not enabled they would need to be enabled by an admin
issueFunction in parentsOf() should work if i remember correct
Inside the () you have to write another JQL function inside "" and then where ever you would use "" in your normal jql expression use '' instead
What I tend to do is write my JQl expression i want in the quotes first then add the scriptrunner part
Best,
Clark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In ScriptRunner for Jira DC, parentsOf is for getting parents of subtasks.
To get parents of items from Epics upwards you need to use portfolioParentsOf
https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/portfolio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not clear to me if some ScriptRunner functions aren't enabled or what. I have project-admin privs (not Jira admin privs), so how would I know?
I can say that many functions like parentsOf() and portfolioParentsOf() do not appear in the auto-complete when I'm constructing JQL:
And when I try to use them to return even the most basic, known things, they seem to quietly fail:
I see also that the ScriptRunner documentation linked earlier makes it clear that:
Of course it hasn't been called that for years, having been renamed "Advanced Roadmaps" and now "Plans". Whatever it is, it's definitely part our our Jira Data Server instance, as many teams are using Jira Plans for their roadmapping efforts.
I can't help but call out (strongly) that basic issue hierarchy traversal like this should be a built-in feature for Jira. I realize the historical messiness (subtask parents aren't like story parents, etc). But not being able to use JQL (without add-ons) to find the parent of an issue is ridiculous. But enough pointless complaining.
We've got the add-ons. Why aren't they working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mykenna Cepek
Looking at your latest images, your subfilter is wrong, I think.
Where you are using ("key=7133") you should be using ("key=ET-7133")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still nothing:
That last query was to convince myself that whatever was after "in" really mattered.
ET-7133 exists, is an Epic, and has a Feature issue as a parent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you show us a screen image from the roadmap that shows ET-7133 as a subordinate issue under another issue?
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.
I am less familiar with the roadmap functionality in Jira on-prem, so some of my questions/suggestions may be off base.
Was making ET-7133 a subordinate of DPMWM-177 a recent change?
If you look directly at the details of the ET-7133 issue, do you see that it contains a link to the DPMWM-177 issue?
If you try the same filter and plug in ET-6841 instead, do you get any results?
Has a full re-index been performed lately? I saw this comment in the ScriptRunner document:
After first install the version of ScriptRunner containing these functions [portfolio functions], a full reindex is required, otherwise they will only show results for issues updated from that point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was making ET-7133 a subordinate of DPMWM-177 a recent change?
If you look directly at the details of the ET-7133 issue, do you see that it contains a link to the DPMWM-177 issue?
Yes, both '7133 and '6841 show this:
If you try the same filter and plug in ET-6841 instead, do you get any results?
Nope:
Has a full re-index been performed lately?
We normally re-index every 2-3 weeks. ScriptRunner was installed years ago.
The admins also tell me that a "background re-index" occurs at 2am daily.
I also noticed this interesting result, suggesting that the parentsOf() function is available (since it can tell when such a function isn't available):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To reiterate my question: why can't I get the parentsOf() function to work?
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.