How to get specific url using inwardIssue

Steven Johnson
Contributor
January 4, 2023

Hello,

I have used the following syntax in order to send the url link in an email, of a newly created story: {{issue.issuelinks.last.inwardIssue.url}}

I have not had any issue with it until now. I guess I didn't have any issues before because there was only the one link listed under Issue Links > is prerequisite of, but the one that isn't working as intended has two links listed (screenshot below).

I'm needing to get the url of the last issue that was created (and linked) to my story that is marked done. It only brings back the url to the "QDCJ" story, but I need the "KPBF" url and can't figure out how to do that.

I've also tried first.inwardIssue, since there are only two issues and the one that comes back for "last" isn't the right one, but "first" doesn't return anything.

What am I missing?

Thanks!

Added Edit: when I run the following, I get links to stories that do not seem to be inward or outward. {{#issue.issuelinks}}{{issue.issuelinks.inwardIssue.url}}{{/}} It gives me the current issue, and two other prerequisites to the QDCJ-91 issue below.

So I definitely am missing something or really don't quite understand how the inward/outward issues work.

 

url issue.jpg

2 answers

0 votes
Steven Johnson
Contributor
January 4, 2023

For simplicity's sake, here's what I'm getting back right now:

{{issue.issuelinks.inwardIssue.key}} --> KPBF-2237, QDCJ-91 
{{issue.issuelinks.last.inwardIssue.key}} --> QDCJ-91
{{issue.issuelinks.first.inwardIssue.key}} --> <blank>

So how do I return the KPBF-2237? Seems like "first" should work, but there's obviously something that I'm not taking into account.

0 votes
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2023

Hi @Steven Johnson 

 

The issue is with the last keyword.

You take all the links, get the last (QDCJ-89) then return inward link but it do not have any and will return null.

 

You need to use the following if you want all the links

{{issue.issuelinks.inwardIssue.url}}

or

{{issue.issuelinks.outwardIssue.url}}

 

Regards

Steven Johnson
Contributor
January 4, 2023

I only want one link, the KPBF link...but I cannot seem to be able to pull that link no matter what syntax I use.

So when I use "last", it does return a value, but it is only the QDCJ, which isn't the one I want. "First" doesn't work, so how do I get the KPBF link to return?

Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 5, 2023

Actually you have 3 links equals to issue.issuelinks

KPBF-2237,

QDCJ-91

QDCJ-89

Last seems to be QDCJ-91

First link may be QDCJ-89 and do not have issue.issuelinks.first.inwardIssue

If it's the case I guess {{issue.issuelinks.first.outwardIssue.key}} should return QDCJ-89.

 

You cannot really be reliable on the first or last link as it's depends on the order you added them.

 

You have to find a way to filter to filter all links and only get the one you want ?

In this specific case you are expecting KPBF-2237 it will always be the case ? What the logic here, you want links from KPBF project ?

 

Regards

Steven Johnson
Contributor
January 10, 2023

What I am wanting is the get the link to the issue that was just created by the trigger, with the "create" action. So since it will have just created it, it should be able to return the most recent issue.

I am currently using {{issue.issuelinks.inwardIssue.get(0).key}} in order to do this successfully, so unless I have another condition that I am just not falling upon yet, it appears to work how I intended.

Suggest an answer

Log in or Sign up to answer