Using automation on smart links

Neil Armstrong November 28, 2022

I'm trying to see if it's possible to add a tag to a story if the design smart link is populated- is that possible? The goal is to be able to search for tickets that have a link to a figma populated in the 'designs' smart link. 

 

Thanks!

1 answer

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2022

Hi @Neil Armstrong 

Because I'm not actually a regular Figma OR Jira Cloud user, can you tell me how the Figma smart link is presented in the issue?

I was able to add a Weblink to a Figma I just created, as well as paste that link in a comment, which made it into a Smart Link that I can hover over, preview, etc.

If either of those cases is how you're adding smart links to a Jira story, then I think these are your two options:

Link as Weblink:

Screen Shot 2022-11-29 at 3.23.35 PM.pngYou'll have to make a Web Request to Jira's REST API for web links, and see if any of them include "https://www.figma.com/"

Details on making web requests to Jira are here: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

You'd want to hit an endpoint like: https://YOURHOST.atlassian.net/rest/api/3/issue/{{triggerIssue.key}}/remotelink

(I'm thinking you'd trigger off of "Issue updated".)

So then you'd do need to use Advanced branching to iterate through all of the weblinks:

Screen Shot 2022-11-29 at 3.36.38 PM.png

Then do an Advanced compare condition to see if any of them contain the Figma URL:Screen Shot 2022-11-29 at 3.37.06 PM.png

Link in Comment:

Screen Shot 2022-11-29 at 3.23.55 PM.png

If you're looking for links in comments, it's a lot easier. You'd just trigger off of Issue commented and then used the Advanced compare condition to check if {{comment}} contains the Figma URL.

If the comparison succeeds, then you'd use the Edit the issue action to add your label.

Let me know if this makes sense, or if you have any questions.

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2022

Oh! Rereading your original post, if "Designs" is actually a URL field, this is even easier.

You would trigger on "Field value changed" for the Designs field and then do an Advanced compare condition to check if {{fieldChange.toString}} contains the Figma URL.

Suggest an answer

Log in or Sign up to answer