In Jira Cloud Automation, how can I find the link type used in a branch on related issues?
Asked by Cash Coyne:

I have a branch on related issues in an automation rule and I want to find out the Link Type of the related issue but I can't figure out how to get it (the inward link text and the outward link text).

Any ideas? I tried {{LinkType}}, but that didn't return anything.

This is the branch:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/302090i00598CA2AF68FA47/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Bill Sheboy
body: Hi [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720)

I recommend using the steps from the how-to article for finding smart values, looking at an example issue, and that will indicate the correct smart value path you need.

The steps are:

* identify an issue which has your field(s)
* call a REST API function with a browser to search for your issue:

```
https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names
```

* search on the page for your field, such as with CTRL-F
  * if you find the field, you will also find the smart value, custom field id, and structure / attributes it has
  * if you do not find the field, it is not supported by automation rules

I provided the steps as it appears the how-to article, linked below, has been removed from the documentation pages: <https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Kind regards,  
Bill

comments: author: Cash Coyne
body: Hi Bill, I've found some info, but not sure how to use it in automation. Based on this screenshot, it looks like issuelinks is a collection and I'm interested in getting the Nth object in the collection. In there, it looks like I want to get the type.inward (and then name?) to get the type of inward link. And I can get the inwardIssue.key to get the Jira issue key.

Can you provide pointers on how to access this in automation as I'm not familiar with getting info out of properties in objects in lists? I'd think I have to loop thru the links to find the linktype I'm looking for the given issue key?

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/302359i4FDBDB06666B179A/image-size/large?v=v2&px=999 "image.png")


author: Bill Sheboy
body: The specifics of how to do this depend on the details of your rule. You are only showing the branch, so without more context it is difficult to suggest more.

Although if inside of the branch looping over the issues, if you know each issue has one-and-only-one link, you refer to that single one in the inwardIssue list. And remember that some links are directional, and so if that is the opposite of what you want try using the outward one.


author: Bill Sheboy
body: Hi [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720)

Just checking if this answered your question. If so, please mark this one as "answered" to help others find solutions faster. If not, provide any additional information to help the community provide suggestions.

Thanks!


author: Cash Coyne
body: I ended up doing things differently using if/else components.

However, this is something I will use in the future. Thanks,


Tags: cloud

issue-link

jira

link