How to create a Column in Jira Structure to show only LInked Issues to a Particular Jira Project
the current formula for linked issues in Structure is the following:
Anyone can help?
thanks
Laura
Hi @Laura Pellizzari
I think you should filter the link collection before you group/map it, keeping only links where the “other side” of the link belongs to your target project. Try the following one.
WITH markdown(issue) =
CONCAT("[", IF issue.status.category = "Done": "~", issue.key,
IF issue.status.category = "Done": "~", "](", issue.url, ")"),
other(link) =
IF link.source.key = key : link.destination ELSE : link.source
:
issueLinks
.FILTER(other($).project.key = "ABC")
.GROUP(IF $.source.key = key : $.type.outward ELSE : $.type.inward)
.MAP(CONCAT($.group, " ", $.elements.MAP(markdown(other($)))))
Hi @Gor Greyan
thanks for your support, can you please suggest how to correctly accomodate the central part:
other(link) =
IF link.source.key = key : link.destination ELSE : link.source
:
when added the system does not recognize the variable anymore and it does not give any result.
thanks a lot
Laura
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Laura Pellizzari
Thanks for the follow up:
Please try this one
WITH markdown(issue) =
CONCAT(
"[",
IF issue.status.category = "Done" : "~", issue.key,
IF issue.status.category = "Done" : "~", "](", issue.url, ")"
),
/* Return the issue on the “other side” of a link */
other(link) =
IF link.source.key = key : link.destination ELSE : link.source
:
workItemLinks
.FILTER(other($).project.key = "ABC")
.GROUP(IF $.source.key = key : $.type.outward ELSE : $.type.inward)
.MAP(CONCAT($.group, " ", $.elements.MAP(markdown(other($)))))
If you prefer to filter by project name instead of key, change the filter line to:
.FILTER(other($).project.name = "My Project Name")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, please have a look to the screenshot, I think the problem is in the middle part:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Laura Pellizzari
Yes, you closed the WITH
block too early.
The colon :
after CONCAT(... )
ends the WITH
, so other(link)
is parsed as the main expression → error.
Add a comma after the first definition and keep one single colon only at the very end of the WITH
block.
Also use single equals =
, not ==
, in Structure formulas.
WITH markdown(item) =
CONCAT(
"[",
IF item.status.category = "Done" : "~", item.key,
IF item.status.category = "Done" : "~", "](", item.url, ")"
),
other(link) =
IF link.source.key = key : link.destination ELSE : link.source
:
workItemLinks
.FILTER(other($).project.key = "ABC")
.GROUP(IF $.source.key = key : $.type.outward ELSE : $.type.inward)
.MAP(CONCAT($.group, " ", $.elements.MAP(markdown(other($)))))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I did everything you report above with no result..
Below is the original Formula for generic Linked Issue column already present in Structure as default, that works and display all the linked issues. this is the one I am trying to modify to have it displayed only linking to my specific project
thanks
Laura
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Laura Pellizzari
Sorry, and thank you for follow-up.
Let's try this one.
/* Displays all linked work items and the link types using markdown language. */
WITH markdown(item) = CONCAT(
"[", IF item.status.category = "Done" : "~", item.key,
IF item.status.category = "Done" : "~", "](", item.url, ")"
):
workItemLinks
/* Keep only links whose “other side” belongs to project ABC */
.FILTER(
(IF $.source.key = key : $.destination.project.key ELSE : $.source.project.key) = "ABC"
)
.GROUP(IF $.source.key = key : $.type.outward ELSE : $.type.inward)
.MAP(CONCAT($.group, " ", $.elements.MAP(
IF $.source.key = key : markdown($.destination) ELSE : markdown($.source)
)))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, the formula now does not give error, but it doesn't display anything on the column where it should be expected.
thanks
laura
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Laura Pellizzari
Thanks for the answer.
Please paste this temporary formula to verify that workItemLinks
returns what we expect:
workItemLinks.MAP(
IF $.source.key = key : $.destination.key ELSE : $.source.key
)
You should see a list like [ABC-12, HPI-7...]
.
If this is empty → the current issue has no links in the structure rows you’re inspecting.
Then paste this to see which project keys actually appear:
workItemLinks
.MAP(IF $.source.key = key : $.destination.project.key ELSE : $.source.project.key)
.UNIQUE()
If you don’t see "HPI"
In that list, the filter = "HPI"
will remove everything.
If the debug shows HPI
, use this version, which trims and uppercases the project key before comparing:
WITH markdown(item) = CONCAT(
"[", IF item.status.category = "Done" : "~", item.key,
IF item.status.category = "Done" : "~", "](", item.url, ")"
):
workItemLinks
.FILTER(
TRIM(UPPER(
IF $.source.key = key : $.destination.project.key ELSE : $.source.project.key
)) = "HPI"
)
.GROUP(IF $.source.key = key : $.type.outward ELSE : $.type.inward)
.MAP(CONCAT($.group, " ", $.elements.MAP(
IF $.source.key = key : markdown($.destination) ELSE : markdown($.source)
)))
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.