Background:
I have used a successful automation for over a year that looks up the tickets completed in the last week, and emails:
This is the successful automation's content:
<strong>Back Office Functionality</strong>
{{#lookupIssues}}
{{#if(equals(epic Link.key, "SMGPORTAL-2226"))}}
<li><a href=https://cylogy.jira.com/servicedesk/customer/portal/8/{{key}}>{{key}}</a> | {{summary}} ({{website}})</li>
{{/}}
{{/}}
The email looks like:
Title
TICKET-124 | Name of ticket (website)
TICKET-125 | Name of ticket (website)
(repeated for 5 different epic links)
My problem:
I need to organize this list based on the component now, not the epic link. I can not find a smart value for the component that works. I have tried all the below. I have read all the documentation and searched other community posts. All my tests return no results.
My request:
I am looking for the same email outcome as above, but it will be based on the component instead of epic link.
What I've tried, with no success:
{{#lookupIssues}}
{{#if(contains(issue.components.name, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(issue.component.name, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(components.name, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(components, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(issue.component, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(issue.components, "Back Office Functionality"))}}
{{#lookupIssues}}
{{#if(contains(ComponentName, "Back Office Functionality"))}}
In my experience...Components are one of those smart values which behave like a list and an array in rules, depending upon the context. To do what you ask, please try this:
{{#lookupIssues}}{{#if(components.name.match("(blue comp)").size.gt(0))}}{{key}}; {{/}}{{/}}
How this works:
Please adjust for your component values and whatever you need returned from the lookup.
Kind regards,
Bill
Hi @Bill Sheboy ,
I should have posted this months ago.... that totally worked.
How did you learn that? I haven't seen that syntax in the smart value and lookup documentation.
Final outcome:
<strong>Back Office Functionality</strong>
{{#lookupIssues}}{{#if(components.name.match("(Back Office Functionality)").size.gt(0))}}<li><a href=https://cylogy.jira.com/servicedesk/customer/portal/8/{{key}}>{{key}}</a> | {{summary}} ({{website}})</li>{{/}}{{/}}
Looks like:
Title
TICKET-124 | Name of ticket (website)
TICKET-125 | Name of ticket (website)
(repeated for 5 different components)
Thank you!
Lindsay
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!
I have learned many things about automation rules by experimentation and reading posts in the community. I recommend watching the automation product area for new articles and discussions:
https://community.atlassian.com/t5/Atlassian-Automation/ct-p/automation
That is where details of smart value, list filtering was first described: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Also in the documentation, some of the really helpful stuff is only shown in the examples, and not in the top-level links:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the references.
Can you advise how I can adjust the syntax so it lists tickets without a component (component = empty)?
Thanks,
Lindsay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are several ways to do that check, and two of them are:
{{#lookupIssues}}{{#if(components.name.size.eq(0))}}{{key}}; {{/}}{{/}}
or
{{#lookupIssues}}{{#if(components.name.isEmpty())}}{{key}}; {{/}}{{/}}
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.
Based on how fixVersion works, I would have expected {{lookupIssues.components.name}} to work, at least to print them out.. But its not. Guess its one of them fields which isnt exposed in lookupIssues data.
Hopefully others can share if they are able to make it work.
*if* components is not exposed through lookupIssues but you still want to do it, you may have to make a REST call to search for the issues and implement this logic that way.
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.