JIRA automation mail tag error
Asked by Semih APAYDIN:

Edited.  

Hi,  
I am trying to make an automation rule for creating and closing sprints which will report message. But i cant fetch the story points data. I checked the community and did same as the examples but still same problem.  
This is my html code:

\<body\>  
\<div class="container"\>  
\<!-- Main Heading --\>  
\<h1\>AY Board Sprint A??l?? Mailidir, deneme ama?l? olu?turulmu?tur, dikkate almay?n?z.\</h1\>  
\<p\>(like {{issue.summary}})\</p\>

\<!-- Second-level Heading --\>  
\<h2\>Agile Y?netim Sprint Report'u ekte oldu?u gibidir:\</h2\>  

\<ul\>  
\<!-- List items and highlighted text --\>  
\<li\>Agile Y?netim olarak \<span class="highlight"\>{{sprint.name}}\</span\>' ko?umuz ba?lam??t?r.\</li\>  
\<li\>There are \<span class="highlight"\>{{lookupIssues.Story Points.sum}}\</span\> story points remaining.\</li\>  
\<li\>The highest story point value is \<span class="highlight"\>{{lookupIssues.Story Points.max}}\</span\>.\</li\>  
\<li\>\<span class="highlight"\>{{sprint.name}}\</span\> 'mizin \<span class="highlight"\>{{sprint.startDate.format("yyyy-MM-dd")}}\</span\> ba?layacak \<span class="highlight"\>{{sprint.endDate.format("yyyy-MM-dd")}}\</span\> bitecektir.\</li\>  
\<li\>Sprint Board'umuza \<a href="{{sprint.originBoardlink}}" class="highlight"\>buradan\</a\> ula?abilirsiniz.\</li\>  
\<li\>Sprint Hedefimiz: \<span class="highlight"\>{{sprint.goal}}\</span\>\</li\>  

\</ul\>

\<p\>Bilginize\</p\>  
\</div\>  
\</body\>  

<br />

The rule is:  
1- Trigger function- When sprint closed or created  
2- Branch Rule- all Issue for sprint  
3- JQL condition-sprint = {{sprint.id}}  
4- Send Mail(HTML)  

in the log part the issue values are seem passed from jql condition but still empty  
this is the output:  
![tests.png](https://community.atlassian.com/t5/image/serverpage/image-id/341503i53B2987CD8074D26/image-size/large?v=v2&px=999 "tests.png")  

IMPORTANT: I am using Jira Server not Cloud


Answers:
author: Semih APAYDIN
body: .


author: Bill Sheboy
body: Hi [@Semih APAYDIN](/t5/user/viewprofilepage/user-id/5562665) -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

When iterating over a list of things, such as {{#lookupIssues.first.sprints}} ... {{/}} only things at that scope, and lower, are visible. And so your references to {{issue.Story Points.sum}} will not work.

When you need multiple values in a message like you show, consider using the Create Variable action to build each piece.

I recommend pausing to identify the source of each piece of information for your message, building them one by one to confirm they work, and then assemble them into a message.

Kind regards,  
Bill

comments: author: Semih APAYDIN
body: Hi Bill Thanks for your response,  
I edited the question as you said. Do i need to give any different information?


author: Bill Sheboy
body: Thank you for the additional information. Here are some observations for what you provided:

There is no rule trigger for sprint closed or created with Jira Cloud automation. Those are two different triggers. Which trigger are you using?

And...when a sprint is created, it has no issues yet, so why would this rule try to list the issues at that time? Do you instead want a separate rule, triggered on Sprint Started?

The {{lookupIssues}} smart value is only available when the Lookup Issues action is used in a rule: <https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues>

Your rule is branching on the issues when the sprint was *closed* or *created*. Are you trying to send:

1. one email containing information about all issues in the sprint
2. multiple emails, with one for each issue

Assuming you want to send one email, are you trying to list all issues in the sprint, or only provide the first one as an example issue?

Putting those things together, you could adjust your rule as follows to send one email, assuming only the Sprint Completed trigger is used:

* trigger: Sprint Completed
* action: lookup issues, with JQL of

```
sprint = {{sprint.id}}
```

* action: send email
  * In your email, you may refer to {{lookupIssues.first.summary}} for an example issue in the sprint.
  * If you want to list all of the issues in the sprint, see my earlier comment about iterating over the values.


author: Semih APAYDIN
body: Thanks for your response [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) . There like 3-4 issues on sprint. I want to send automation mail about it when it created or closed. i also used lookupissues action still doesnt work. it doesnt fetch the data of stoyry points. i want to send one mail not for each issue. it will calculate sum of story points of issues and also give the max story point issue as information. Also for your trigger question: I am using 2 different triggers i mean i created 2 different rules with same html content. i am using ++JIRA SERVER++


author: Bill Sheboy
body: First, please read my response above, noting these things:

* When a sprint is created, it has no issues assigned yet
* See the example rule I described for the trigger Sprint Completed, and compare that to your rule.

If that does not help find the problem, please post the following for context:

* an image of your complete rule
* images of your rule action details
* an image of the audit log details showing the rule execution


author: Semih APAYDIN
body: My bad Bill i told the situation wrong to you. I mean to say when sprint started not created. and also after sprint closed. I want to send mail as an automation to users. Which will include sprint name,date,goal and story point sum,max values. i mean sum of the all issues story points and the issue with max story point. I get the data with html code above except the story points part i dont know why? i even tried to use sprint issue rule but still couldnt get any data as you can see from the image in the story point remaining part no data highlighted. I dont have action named lookup action in my jira. Dunno why? i am new to era. Due to company rules i cant send complete image of rule i tried to explain with plain text sorry for misinformation.


author: Bill Sheboy
body: Context is important for automation rules. And so the location within the rule may be preventing accessing the Story Points field data.

Please post an image of your complete rule to show that context.

If you are unable to do so, I recommend working with your Jira Site Admin to contact the Atlassian Support team for assistance: <https://support.atlassian.com/contact/#/>


Tags: automation

cloud

jira-cloud

tag