Forums

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

Automatically sum story points at end of sprint and send a slack message

Mark G February 17, 2023

Hi everyone 

      I'm trying to send a slack message to a specified channel that sums up the story points of each of my team members at the end of sprint. my biggest problems is that the sum function doesnt seem to like to be published as text on the slack messages. Also it seems when I do look up issues I pass in an array of all issues. 

3 answers

1 accepted

2 votes
Answer accepted
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.
February 17, 2023

Hi @mgilpatrick 

Would you please most images of your automation rule and the audit log details showing the rule execution?  Those may provide context to explain what you are observing.

Until we see those...When you want just the sum of values from Lookup Issues, please use something like this:

{{lookupIssues.Story points.sum|0}}

I added a default value of zero in case there are no sizes.

When instead you want to do this by different people, try using conditional list filtering, by person, or multiple calls to Lookup Issues with different JQL.

Kind regards,
Bill

Mark G February 21, 2023

hi i sent details below 

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.
February 21, 2023

Thanks for that information, and I think the problem is your schedule trigger has JQL.  Try removing that, and adjusting like this...

  • trigger: scheduled, with no JQL
  • action: lookup issues, with JQL for one specific assignee
  • if/else condition block...
    • advanced compare condition: testing if {{lookupIssues.size|0}} is greater than 0
    • action: send Slack message, referencing the lookup and the assignee as {{lookupIssues.first.assignee.displayName}} or you can hard-code it
  • repeat the above 4 steps for each assignee...Remember to use if/else or processing will stop after the first one.

 

Or if you have many potential assignees you may make this dynamic for any number of assignees.  This can help has rules have a maximum step (component) limit of around 60.

 

  • trigger: scheduled, with no JQL
  • action: lookup issues, with your JQL and with no assignee check other than not empty... project = "EN" AND sprint IN openSprints() AND assignee IS NOT EMPTY
  • advanced compare condition: testing if {{lookupIssues.size|0}} is greater than 0
  • advanced branch:
    • variable: varAssignee
    • smart value: {{lookupIssues.assignee.accountId.distinct}}
      • action: lookup issues, with your JQL for the branched-to assignee... project = "EN" AND sprint IN openSprints() AND assignee = {{varAssignee}}
      • action: send Slack message, referencing the lookup and the assignee as {{lookupIssues.first.assignee.displayName}}

How that one works...

  1. trigger the rule as before
  2. check if there are any assigned issues to report on
  3. get a list of the distinct assignees, and
  4. then iterate over them to send the issues and messages
Mark G February 21, 2023

I feel like this is so close Let me attach what happens when I did that

please note that initial look up which is assignee agnostic returns an issue 

 

Screen Shot 2023-02-21 at 5.04.26 PM.png

Here's the branch

 

Screen Shot 2023-02-21 at 5.04.33 PM.png

here's the full JQL I use underneath the branch

project = "EN" AND status IN ("Done","completed", "Released to Design Repository","Released to Production") AND sprint in opensprints() AND assignee = varAssignee

Screen Shot 2023-02-21 at 4.57.51 PM.png

how should this JQL return a query when it includes the created variable / smart value? Right no it returns 0 issues which I think is the problem. there's 1 issue that's completed that should fall under this query if it's testing for each assignee. (see above)

Screen Shot 2023-02-21 at 4.58.02 PM.png

 

finally here's the output which is strange to me.. it only messaged once ( the line below new is from 1 run) 

 

Screen Shot 2023-02-21 at 4.59.57 PM.png

 

When I tried to validate query it says 0. right now there's 1 ticket thats supposed to be coming through from that query for 1 person ( we just started a new sprint) 

 

From what I can tell it ran through and found no one and then couldnt send a name based on that. But the question is why is it not picking up that 1 ticket? 

 

Also how to do I get it not to even run once or to return that it found no one?

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.
February 23, 2023

When you define the branch (or a created variable) you just supply the name, such as varAssignee

And when you use it, treat it as a smart value expression with {{varAssignee}} And so your JQL for the Lookup Issues action inside the branch would be this:

project = "EN" AND status IN ("Done","completed", "Released to Design Repository","Released to Production") AND sprint in opensprints() AND assignee = {{varAssignee}}

 

Regarding not-running when there are no issues...the first advanced compare condition should do that.  As the branch will only iterate over assignees who have issues, the rest should work as expected.

Mark G February 24, 2023

The query doesn't resolve or validate the "assignee = {{varAssignee}}" with the the "{{"" and when I don't include the "{{}}}" it validates the query to return 0 issues. 

I think after that this will work...

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.
February 24, 2023

If you mean you cannot verify the JQL when editing the rule, that is correct.  It can only resolve at run-time.

If you mean something else, would you please show images of the Advanced Branch definition and the Lookup Issues action inside the branch?

Mark G February 27, 2023

I mean the button to validate query becomes disabled.Screen Shot 2023-02-27 at 4.22.36 PM.png

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.
February 27, 2023

That is correct. 

When a JQL statement in the rule editor contains smart values (such as {{varAssignee}} ) it cannot be validated yet.  Only when the rule runs can it be evaluated.

Marcel Rossouw
Contributor
January 9, 2024

Hi @Bill Sheboy this is very helpful - thank you.

When I run this automation within our active sprint using the dynamic option I get hit with this error in the audit log:

Payload for custom variable is too large, try reducing the amount of data stored in your custom smart variable.

The only difference being that I'm sending emails rather than to slack for the time being whilst testing.

We currently have around 75 completed tickets assigned to various engineers in an active sprint so I didn't think it was too big.

It is setup 100% correctly as noted above in your steps - is there anything else I can do or try other than having to add each individual assignee (we have several).

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.
January 9, 2024

Hi @Marcel Rossouw 

As this is an older thread, you may want to create a new question and link back to this one for context.  That will ensure the maximum number of people see it to offer ideas.

In the meantime...

Without seeing your complete rule and audit log details, and the details of the action with the symptom, it is difficult to know what to suggest.  When you post your new question, post the link here or ping me in the new question so I can take a look.  Thanks!

Kind regards,
Bill

Like Marcel Rossouw likes this
0 votes
Tugba Capaci
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.
February 22, 2023

Hi @mgilpatrick  ,

 I've recently designed a Jira-Slack Integration app on Actioner. You can check it out here.

For now, it does not include story point calculation feature however it would be easily implemented by following these steps: 

1- Create an action that calculates the sum of the story points.

2- Add 'sprint : closed' event to your webhook on Jira. 

3- Add a new step to the workflow named "Get issue event from Jira" that triggers the action created in the first step whenever a sprint is closed. 

 

In case you're interested I'd be more than happy to help you with such a customization.

Best,

Tugba

Mark G February 23, 2023

thanks for the effort but this actually didn't help me 

Like Tugba Capaci likes this
0 votes
Mark G February 20, 2023

When I run this this is what I get. A lot of messages. how would I get it to send 1 message with each engineers story points?

 Screen Shot 2023-02-20 at 10.35.45 PM.pngScreen Shot 2023-02-20 at 10.34.25 PM.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events