Issue Automating Parent Story Points When Null/Empty

Lewis Cook August 3, 2021

Hi All,

 I've been working on automation incrementing story points of parent issues when child issues have story point changes. This is generally going well apart from the following use case:

  • Child issue has a story point value
  • Child is edited to have no story points

All the other scenarios are working fine, I am calculating the delta of story points on the child and adding/removing story points from the parent accordingly.

The stumbling block is around a couple of smart values which I'll share my audit log actions below:

  • From/Old Story Points = '{{changelog.Story Points.fromString|0}}'
  • To/New SP = '{{changelog.Story Points.toString|0}}'

If the reverse scenario occurs (start with no story points and edit to have a value). Old story points is accurately logged as 0 and the New story points is also accurate.

In the problematic scenario the To/New SP is coming back as a blank (showing as '' in the log).

I guess I can set up a new if/else block for when the New SP is blank and override it with a new "0" variable. However I can't work out why fromString is working fine with the "|0"  which should be doing just that when toString is falling over.

Any advice help welcome!

Thanks

Lewis

2 answers

0 votes
Lewis Cook August 4, 2021

I've worked around this issue with the following:

Screenshot 2021-08-04 102319.png

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 3, 2021

Hi @Lewis Cook 

To be clear, is your scenario that there was a Story Point value and it was later cleared?

If so, I recall a couple of open defects related to JQL (and so probably the API) for that scenario where the empty logic isn't quite correct yet.

My suggestions:

  • get this to work however you can (e.g. if/else), and
  • as a site admin for a paid instance of Jira, submit a defect to the customer support team to track down the root cause.  They can see logs customers cannot see.  https://support.atlassian.com/contact/#/  And then post back here what you learn.
  • Or...abandon change logs and use LookupIssues calls to re-sum the story points whenever one changes for a child issue.

Best regards,
Bill

Lewis Cook August 3, 2021

Hi @Bill Sheboy ,

 Yep that is the scenario I am having issues with:

  1. Sub-task has story points
  2. Sub-task has story points cleared
  3. Automation fails because {{changelog.Story Points.toString|0}} returns a "" rather than 0

The reverse scenario works fine with {{changelog.Story Points.fromString|0}} returning a 0.

I'll probably take your advice on the support ticket.

I shall also take a look at LookupIssues as an alternate option.

Thanks

Lewis

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events