Script Runner PlugIn: linkedIssuesOf - is it sensitive to states of linked issues?

I am using JIRA 5.2. I am having problems with the linkedIssuesOf query, when I change the subquery to point to a specific JIRA.
Background:
  • We have a large program spanning multiple projects. The structure of our JIRAs are like this: PGMLevel-Epic1 has PGMLevel-Story1, ... PGMLevel-StoryN. Each PGMLevel-StoryK will have 'relates to' link to PROJ1-Stories, .., PROJp-Stories
  • We are trying to define a filter to get all the PROJ1-Stories, .., PROJp-Stories under PGMLevel-Epic1.
So, this seems to be a good candidate for linkedIssuesOf, except I can't seem to get it to work.

issueFunction in linkedIssuesOf("\"Epic Link\"= PGSMPPRO-553", "relates to")

But as off right now the results are still wrong - I get 1 issue back when I should be getting 4. oddly enough, the only result that shows up is where both the story (from the output of "\"Epic Link\"= PGSMPPRO-553") and the linked story (from the previous result set) have a Status of DONE.

<th>
Story Under Epic Status
</th><th>
Linked Story Status
</th><th>
Does Linked Story show up in query results?
</th>
Done Done Yes (this is working as expected)
Done Not Done No (but it should)
Not Done Not Done No (but it should)
Not Done Done No (but it should)

Have a DONE, DONE default seems strange. Maybe I am still doing something wrong? The screenshot below shows the contents and linkages - scroll to right of picture - in the stories under this epic (all the linked stories show "relates to" links) . I am only getting the issue 851 being returned

2 answers

1 accepted

0 votes
Accepted answer

This is already filed as a bug https://jamieechlin.atlassian.net/browse/GRV-245. Still open.

OK, I finally figured this out by setting up some more understandable test cases.

The problem had nothing to do with DONE states. It had to do with Relates To links.

Although JIRA uses "Relates To" to refer to linkages in either direction, it does not seem to work that way in reality (at least the way ScriptRunner treats it)

So, if you have 2 cases

  • Epic1-> Child Story 1
    • Create a Relates To link from Child Story 1 to another story, Link Story 11
    • Create a Relates To link from Link Story 12 to Child Story 1 (note the reverse direction)

The query issueFunction in linkedIssuesOf("\"Epic Link\"= Epic1", "relates to")

will only relate Child Story 1 and NOT Child Story 2.

I think somebody else reported this problem, but I am not sure if this got fixed. I am still seeing this problem with the latest plugin Script Runner 2.1.11 and running on Jira 5.2

Sorry made a mistake above.

The query issueFunction in linkedIssuesOf("\"Epic Link\"= Epic1", "relates to")

will only relate Link Story 11 and NOT Link Story 12. Worse, there is absolutely no way you can write the query to ever get back Link Story 12

It would be great if Script Runner handled this. Otherwise, the only fix is to go reverse all the links to always go from Child Story 1->Link Story 12.

This is a major pain to go fix all that and keep these rules intact as you create new Jiras.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,375 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you