Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Arrays in Automation

Edited

Hi,

I'm trying to make a custom report for satisfaction and other details using the automation tool. 

I'm in need of an array or a method in which to parse all the tickets using a query and then storing all the data in some form that's then accessible to then put into an email and be sent to a team of people.

I figured as I couldn't see any array function I would us the description of the first ticket logged in our system as this was a test ticket. 

This is what I have so far.

Capture.PNG

 

So with that I can mark using a comment all the issues that need to be in the report. The bit I can't do is collate all the issues into one list/array of data that I can then send on.

 

One other thing is that if its possible to direct a smart value to a location. So I parse the data from a ticket using a custom field then write that data to a different field in a different issue/ticket. 

 

If anyone has an idea for this. Any help is appreciated.

Thanks

 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Harry Heathcote 

Did you figure out how to do this yet?  If not...Have you investigated using the actions of Lookup Issues and Create Variable?

With lookup issues you can use JQL to get a list of issues, and then parse some of the fields, storing the results in a variable.  

For example, if you had a JQL statement that populated a lookup, you could put into a variable something like this:

<ul>{{#lookupIssues}}<li><a href="{{url}}">{{key}} - {{summary}}</a></li>{{/}}</ul>

Which would give you a simple HTML list of the issues, their summaries, and links to them.  The variable could be used to build this list into a single email.

Please look here for information on the actions Lookup Issues and Create Variable and look here for information on list handling.

Best regards,

Bill

Hi @Bill Sheboy 

Thanks for your answer and sorry for the late response.

I have been looking into it some more as I have the time to do so again but this time for a different problem. 

As it currently stands, I understand some parts regarding lists but not where to apply them. 

The example you gave to get a list of issues in a HTML format.

Where do I put this?

I have tried putting in a create variable segment that's inside a FOR loop to iterate over all tickets matching a JQL query but when I get the email it sends there is no data in it. So, what is it really doing?

2021-02-17 12_42_24-Clipboard.png

Thanks,

Harry

Hi, Harry!  Thanks for clarifying, and sorry I didn't explain my idea better.

When you use a Branch you may process each issue, one at a time.  I was instead suggesting using LookupIssues to process the set of issues.  Using that method your rule would be something like this:

  • Trigger: manual, as you noted
  • Action: LookupIssues with your JQL
  • Action: send email, with HTML and the LookupIssues data as this in the email body
Here is the list:
<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} - {{summary}}</a></li>
{{/}}
</ul>

 

Best regards,

Bill

Hi bill,

Thanks for this, exactly what I was after.

1 last question for you.

How do I go about adding other fields to this? 

The below I have already tried but with no luck,

Here is the list:
<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} - {{summary}}</a>
Location: {{issue.customfield_10395.value}}
Description:
{{issue.customfield_10388.content.text}}

</li>
{{/}}
</ul>

Thanks,

Harry

Hi Harry,

I am glad to hear that helped you, and I'm afraid that Lookup Issues only works for a limited number of fields at this time:

From the resulting issue list, the following issue properties are available to use (custom fields aren't available):

  • {{key}} - Returns the issue key

  • {{url}} - Returns the issue url

  • {{summary}} - Returns the issue summary

  • {{assignee.displayName}} -  Returns the assignee

  • {{reporter.displayName}} -  Returns the reporter

  • {{status}} - Returns the status

  • {{issueType}} - Returns the issue type

  • {{resolution}} - Returns the resolution status

  • {{fixVersion}} - Returns the fix version

  • {{created}} - Returns the date the issue was created

  • {{updated}} - Returns the date the issue was updated

  • {{Story Points}} - Returns the story points for the issue (classic Jira Software)

  • {{Story point estimate}} - Returns the story points for the issue (next-gen Jira Software). Learn more about using smart values with numbers.

There is an open suggestion to add more fields, which you may review and vote for here:

https://jira.atlassian.com/browse/JRACLOUD-75018

That makes sense. 

Thanks for the response.

I will keep an eye on that as it would be very helpful.

Thanks,

Harry

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

New to Jira Automation - goodbye Cron (sort of), hello new project created trigger, new additions to

Hey Everyone! Simeon from the Automation team here. I'm delighted to share some new features and improvements that we are shipping to Jira automation (Cloud only). Firstly, @Sam Harding&nbsp...

2,825 views 10 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you