Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Single email with changed issues per proejct for Scheduled Automated Global Rule

Spiros P.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 15, 2021

It is probably been asked somewhere. But I search and only find similar answers.

I created a scheduled rule which will run every 3 days and for a start will add organizations to issues for multiple projects that have the field emtpy. Rule goes like this for now:

When: Scheduled
project = "A" OR project = "B" OR project = "C"

If: all match
project = "A" (JQL)
Organizations is empty (Issue Fields condition)

Then: Edit issue fields
Organization set to "A name"

Else if: all match
project = "B"
...

Else if: all match
...

At the end I want to add:

Then: Send email
And receive a single email that lists all changed issue's per project.

I am willing to extend the above rule to make several changes in the future, where I will need to be informed of the outcome but without receiving "100" different emails.

From what I have been reading here is more or less what I imagine I would have to add to the email body to achieve this:

blah blah..

<ul>
{{#lookupIssues}}
{{issue.project.name}}
<li><p><a href="{{url}}">{{key}} | {{summary}}</a>: {{Organizations.name}}</p>
</li>
{{/}}
</ul>

Is this correct or close? Can it be done?

I hope my question is clear.

Thanks in advance.

3 answers

2 votes
Alex Koxaras -Relational-
Community Champion
September 15, 2021

Geia sou Spiro!

Interesting automation you got there! You are not far from making your rule working. You've got almost everything figured out! However, the one tiny little piece that's missing is the lookupissue action, which you must place after the trigger. Please find below my rule, with slight modifications (to trigger, one project scoped etc):

send email automation.png

 

Now this rule was built only for a single project, but of course you can add you else statements after the first if. Keep in mind of the limits you have when executing rules across multiple projects.

  • Trigger: you schedule it as you wish
  • Lookupissues: You have to add the action, in order to send that email afterwards. What it does is that it searches for all issues which meet certain criteria (search yields results up to 100)
  • IF/ELSE: You add and separate your edit field, for each project
  • Send email: Outside of the IF/ELSE statement you add your email, just as you wrote it.

 

The only thing that was missing from your rule was the lookupissue. Ohh.. and you might need to modify the email HTML to be a bit more presentable (at least on my outlook client, it's not that presentable). Btw, in what plan do you have your JSM?

Let me know if that works!

1 vote
John Funk
Community Champion
September 16, 2021

Hi @Spiros P.  - Yes, that is close, although the fields you can use with lookupIssues is limited and probably doesn't include the organization. But give it a try. 

You can see more here:

https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Lookupissues

John Funk
Community Champion
September 19, 2021

Yes, you are on the right path.  :-)

0 votes
Spiros P.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2021

Thanks both for your replies. So sending an email at the end of a rule is on the right path.

Geia sou Alex :). We are on the Standard Plan.

I think you are right, Organizations are not included in {{lookupIssues}} properties. I am thinking that including a list of changes in a final email at the end of the rule makes sense. A scheduled rule can check multiple things in one run, although I would keep rules simple and focused (when not testing). But what if it executes for multiple Projects? It doesn't feel right to  enable and receive many emails by action, but I can see JSON there and I will definitely be looking into this next:

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/#Advancedfieldediting-JSON--Supportedfields-amp-operations

Although I am crazy busy, I find myself spending whole working days (not very agile one mioght say) on Jira lately, congesting my browser with Jira tabs. Engaging with the community a bit at the end of such a day happened naturaly. You can say I am a newbie in Jira, so I am reading, testing, reading, making mistakes.

I will be around. My rule is a bit long therefore I didn't attach a screenshot. But I will next time.

Thanks.

Alex Koxaras -Relational-
Community Champion
September 18, 2021

Hey @Spiros P. 

Organizations are not included in {{lookupIssues}} properties.

You don't need the Organization field on the lookupissue. You only need to lookupissues where the organization is empty. The JQL I've given you is valid and tested by my side. Unless I'm missing something.

But what if it executes for multiple Projects? It doesn't feel right to  enable and receive many emails by action

It doesn't matter if the rule runs across multiple projects. I mean you lookupissue will search in these multiple projects, it will perform separate actions, but in the end of the day you will receive only one email with all the issues from all projects.

Suggest an answer

Log in or Sign up to answer