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

Ashok Natesan August 29, 2013
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
Answer accepted
Ashok Natesan August 30, 2013

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

JamieA
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.
September 4, 2013

Correct link is https://jamieechlin.atlassian.net/browse/GRV-305

Can you mark your answer as correct.

0 votes
Ashok Natesan August 30, 2013

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

Ashok Natesan August 30, 2013

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
TAGS
AUG Leaders

Atlassian Community Events