Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,500
Community Members
 
Community Events
165
Community Groups

problem with scriptrunner linkedissuesOf() and linkedissuesOfAll() results

 

Hi,

A filter using linkedissuesOf() is not working properly for me. It is not displaying all the issues. An initiative has 22 child epics, and linkedissuesOf() returns only 12. The 10 missing ones all belong to one new project, so I am not sure if there is some setup missing there.

issueFunction in portfolioChildrenOf('issuekey=x-1') =22 results

issueFunction in linkedIssuesOf("issuekey=x-1", "is parent of") =12 results

 

We have an advanced roadmaps plan based on filters that use linkedissuesOf() and linkedissuesOfAll() functions and it is very important I get all connected issues down to the sub-task level.

Anybody have an idea?

Thanks

issueview.JPG

linkedissuesof().JPGportfoliochildrenof.JPG

 

2 answers

1 accepted

1 vote
Answer accepted

Hi @Boris Gulić ,

Probably, for the other issues not shown, the link name is not: "is parent of".
Check this on one of the issues that is not shown.

Hi,

we are using porfolio Parent Link, not Issue Link with type "is parent of".

All issues are under same Parent Link.

Thanks, i realize my mistake now.

Question still remains, why does this function return 12 results, i would have bet on 0 or 22.

Filipi Lima Atlassian Team May 02, 2022

Hi, Boris,

Looks like some of the issues have the "is parent of" link type. If you want to find the cause of it, check out the list of associations for one or a couple of the 12 that were returning.

You might have both link types (portfolio parent/child + Jira's native Issue Link) for those since the fields are independent. 

0 votes
Filipi Lima Atlassian Team Apr 29, 2022

Hello, Boris!

Let me start with Adaptavist's documentation on the functions:
https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html

See that portfolioChildrenOf will return everything under the issue, including "grandchildren". 

linkedIssuesOf on the other hand only returns direct children.

In addition, are you using JIra's default "Epic Link" to connect it to Stories/Tasks or Portfolio's "Parent Link"?

  • Depending on which one you're using you would need a different query.

Hi,

we are using the portfolio Parent link for Initiative-Epic linking. Down the line we use Epic link for Story-Epic linking, but without going further into the hierarchy and complicating, it isn't working at this top level.

There are 22 issues linked with this same link (see screenshot 1). My understanding is linkedIssuesOf should return all these 22. New screenshot for reference, other issue links here are used for other stuff.

parent.JPG

I went digging a little more and this definetly looks like a bug a to me.

In the database, I get 12 issuelinks of type "Parent-Child Link".

So, I took one of the issues that are missing CCTRIBE-41, deleted what was in the parent link field, then I filled the Parent link field again with the same thing. Voila, there are now 13 results instead of 12. Still can't figure out where are the other links stored and how are they shown on Issue details...

Filipi Lima Atlassian Team May 03, 2022

When removing and re-adding kind of resolves an inconsistency, I tend to question if the issues was not properly indexed for some reason.

Try running a project re-index (assuming all issues involved are in the same project) and see if it catches up.

If that doesn't work, I'd probably start checking if there are duplicate issuelinktypes, maybe run an integrity checker as well.

I would also fetch the <BASE_URL>/rest/api/latest/issue/XXX-123 before and after removing the parent link and re-adding it - maybe something is getting created differently.

Hi,

I tried reindexing and integrity checks, but none worked.

I created a filter finding these inconsistencies and found a total of 40 links. Removed then added again all of them.

For the past week, I am keeping an eye with this filter. It seems no new inconsitencies are being created.

Thanks

Boris

Like Filipi Lima likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you