When Issue Is Mentioned in {{issue.description.body}} add as Linked Issue = Related
Asked by Vincent Lucero:

**Context**

I'd like to improve visibility across related issues by automatically associating them with one another when referenced in either comments OR description body.

**Acceptance Criteria**   
When Issue Is Mentioned in {{issue.description.body}} add as Linked Issue = Related

Example solution in bottom image for solving this when {{comment.body}} contains regex as provided by Jira Cloud default template, but when I attempt to update this, JIRA restricts me to only link issues based on "Trigger Issue" or "Most recently created issue"  

<br />

![Screen Shot 2022-05-19 at 10.57.29 AM.png](/t5/image/serverpage/image-id/198225i82970C490BB0F8E7/image-size/large?v=v2&px=999 "Screen Shot 2022-05-19 at 10.57.29 AM.png")  

![Screen Shot 2022-05-19 at 10.55.44 AM.png](/t5/image/serverpage/image-id/198224i17007CE9B171F196/image-size/large?v=v2&px=999 "Screen Shot 2022-05-19 at 10.55.44 AM.png")


Answers:
author: Bill Sheboy
body: Hi [@Vincent Lucero](/t5/user/viewprofilepage/user-id/4543992)

To use the Link Issues action to a smart value expression, type (or paste) the expression in the field and it will appear below the field. When finished typing/pasting, select the value below the field and it will be used.

This works for many of the actions which have a drop-down list of options for a target issue.

When you expect more than one issue to link, instead use the branching technique that Mark describes.

Kind regards,  
Bill


author: Mark Segall
body: Hi [@Vincent Lucero](/t5/user/viewprofilepage/user-id/4543992) - You could do something like this:

* Create a variable to capture the key referenced in the description
* Branch by JQL
  * key = {{yourvariable}}
  * Link to trigger issue

comments: author: Vincent Lucero
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) do you have an example of how to define variables in JIRA automation for a use case like this?


author: Mark Segall
body: Hi [@Vincent Lucero](/t5/user/viewprofilepage/user-id/4543992) - Taking a step back on this one. I think [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) has the correct answer for this. You should be able to set a smart value in your link. What does the audit log show for your rule?


author: Vincent Lucero
body: I never implemented this rule since it wouldn't allow me to select anything other the "trigger issue" or "last created"

I don't know how to dynamically pass the value representing the Regex response of the mentioned ticket that triggered the automation in the first place.   

Goal is to associate mentioned tickets in comments.


author: Vincent Lucero
body: [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637) [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) any ideas on how I could proceed? ?


author: Bill Sheboy
body: Hi, Vincent. Did you see this part of my response, describing how to use smart values for links?
> To use the Link Issues action to a smart value expression, type (or paste) the expression in the field and it will appear below the field. When finished typing/pasting, select the value below the field and it will be used.


author: Vincent Lucero
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) Yes, the issue is that "Link Issues" as a new action **does not** accept smart values for me. I only can choose Trigger issue and Most recently created issue from the drop down.

Is there something I need to do to activate "Smart Values" as an option in this action?

Note that smart values are mentioned in the text below the dropdown AND shown in the built in "Link issue based on comment.body", so I believe you it is possible... But somehow disabled?

See screenshots:

![Screen Shot 2022-08-31 at 8.59.30 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/213736i507D2A983FE22095/image-size/large?v=v2&px=999 "Screen Shot 2022-08-31 at 8.59.30 AM.png")

![Screen Shot 2022-08-31 at 9.29.11 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/213747iFD104DF171BCACBC/image-size/large?v=v2&px=999 "Screen Shot 2022-08-31 at 9.29.11 AM.png")


author: Vincent Lucero
body: Figured it out... If anyone else encounters this see:  

<https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-to-use-smart-value-in-issue-link/qaq-p/1476480>  

In short, poor UI and you can just begin typing while dropdown is selected.


Tags: cloud