Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Assume this script runs on a Epic Workflow.

Requirement:
Search for the “Story Points” custom field on your instance.

Normal Approach

Code Block
languagepy
sum = 0
for issue in api.search_issues(f'parent = {issue.key}'):
  sum += issue.fields.<your_story_points_customfield_id>
issue.set('<your_story_points_customfield_id>', sum)

Advanced Pythonic Approach

Code Block
languagepy
points = sum([issue.fields.<storypointsfieldkey> for issue in api.search_issues(f'parent = {issue.key}')])
issue.set('<your_story_points_customfield_id>', points)

Info

To test it, get an Epic from the target project, this Epic should have child issues that contain story points != null.

Your test script in the Console should look like this:

...