Forums

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

JIRA automation mail tag error

Semih APAYDIN August 7, 2024

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>


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

IMPORTANT: I am using Jira Server not Cloud

2 answers

0 votes
Semih APAYDIN August 13, 2024

.

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2024

Hi @Semih APAYDIN -- 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

Semih APAYDIN August 13, 2024

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

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2024

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.
Semih APAYDIN August 14, 2024

Thanks for your response @Bill Sheboy . 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

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2024

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

 

Semih APAYDIN August 14, 2024

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. 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2024

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/#/

Suggest an answer

Log in or Sign up to answer