I am trying to get the linked issue type specifically for inward values. If I do issue.issueLinks.inwardIssue, this gives a list of all the keys that are inward issues. If I do issue.issueLinks.inwardIssue.name, nothing shows up (as shown in the email). It says that it should return the type, like Blocks. I am not looking to return "blocked by" or "blocks" (as I can get this to return) I need the relation type itself "Blocks". Does anyone know any other way to return this? I have tried issue.issueLinks.inwardIssue.type and issue.issueLinks.inwardIssue.type.name, and any variation doesn't work. And the context for why I need this is I created an automation that can clone tickets and have their linked relations stay intact with their new counter parts. The automation for this works, I just need to get the correct list values. If I just grab the value like this, {{issue.issueLinks.inwardIssue.name}}, it accounts for both inward and outward links (which causes an incompatibility since my automation works by one way linking). In my automation I am technically using "outward" to set the linking but the example below I created demonstrates based on the smart values given.
Hi @astroud
First thing: in my experience, not all possible / supported smart values and their structure are shown in that built-in help feature. The feature is relatively new, and does not display correct information for all contexts.
And so I recommend using this how-to article to look at what the REST API endpoint returns and is made available to rules. The basic steps are to use a browser tab with an example work item, and then search for issuelinks on the page to see the structure.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Please note well: the how-to shows using the version 2 of the endpoint, which I believe rules still use. There is a later version 3 which could return data rules do not have yet.
When you do that, you will find {{issue.issuelinks}} is a list of items, and the type information is separate from the linked work items, inward or outward.
And so to get just name(s) you want, that would be this, regardless of inward or outward linkage:
{{issue.issuelinks.type.name}}
That would return the list of link type names for all of the linked work items. When you need the type for a specific item, it may help to add list filtering on the inward / outward key before getting the type name.
Kind regards,
Bill
Thank you the rest API has helped me with this, and I thought I came up with a workaround but I guess you also can't get the description types (like blocked by) from the actual inward issues which is interesting. If I do {{issue.issueLinks.type.inward}} it gives a list of all the issues and the inward variant even if it's not an inward issue, I'll have to find a way to filter this somehow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Link directions in rules for smart values can be confusing, challenging, etc.
You could use list filtering to confirm the inward ones are present and only then return just the type. For example:
That variable is filtering on the presence of inwardIssue data, but ignoring it, to only return the link type names. Then it is cleaned up to remove any duplicates.
Or instead, perhaps try this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're the best, {{#issue.issuelinks}}{{#if(exists(inwardIssue))}}{{type.name}},{{/}}{{/}} worked for me! I didn't realize you can add conditions for each value within a list. Thank you so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
To learn more about smart value, list filtering, please see this article on the topic:
https://community.atlassian.com/forums/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
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.
Hello,
Could you provide some more context on how to use linkType? I have tried a few different things and I don't see it show anything. Thanks!
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.