in the addedAfterSprintStart() script function, how to indicate that i want to get the previous sprint?

Cecile Chateau February 2, 2015

Hi, i need to generate monthly stats for 30+ teams including #StoryPoints planned  and realized, sum of estimated time for planned items vs spent time for planned items, same for added items and so on. so some of the stats are already calculated by JIRA itself in the velocity report or sprint report, but not all of them. so i've done the following: i've created one filter to retrieve all issues in the closed sprints, and one filter to retrieve all the issues that have been added to sprints (via the issueFunction in addedAfterSprintStart(board name, [sprint name]) available in script runner since version 3.0). Note that i'm not using the optional sprintname parameter, otherwise i would have to create one filter for each sprint for all the teams, which would totally screw up my automation. i then export the result into excel, and computes my stats out of the excel files. my problem is the following: if one story was added to December sprint, removed from December sprint (because not finished or arbitrated), and then planned for January sprint, the story appears in the addedtosprint() filter, and the sprint field = January sprint only. So i'm wrongly counting the issued as added to the january sprint. so i was wondering if any of the following would somehow be possible:

  • pass a parameter to a registered filter (for instance, is it possible to create a filter issueFunction in addedAfterSprintStart("BOARDNAME", <parameter>), and provide the parameter when calling the http request that generates the filter?
  • is there any available parameter to say "last sprint", "last sprint -1", "last sprint -2", so that at worst i would have to create once all my filters, with issuefunction in addedAfterSprintStart("BoardName", "last sprint -2")
  • create a custom field "list-of-sprints-in-which-the-issue-was-added", and create a script to fill it ? in my example that would allow me to retrieve December sprint, and thus count the issue as added to the December sprint. could you help me generate that script?
  • is there a way to disable the "remove from sprint"? it would not be the best solution, but if the issue was not removed from the sprint, at least i would have the field sprint = December, January, which could help me suppose that the story was added to December and planned to January (as i said, not perfect, as the team could have added it to the January sprint after the sprint starts as well...)
  • any plan on providing the "RemovedAfterSprintStart() function?
  • any other idea you could have that could help me extract the needed info into excel?

thanks a lot for your help

1 answer

0 votes
JamieA
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 2, 2015

That's quite an involved question, so I'm not going to answer each point individually. It sounds like your main purpose is reporting - is that right?

If so, rather than saving all these filters individually, I would programatically iterate through all the projects you care about, and execute the query on latest sprint, or sprint-1 etc. You could concatenate all those results to a csv file which you can open in excel or whatever.

> any plan on providing the "RemovedAfterSprintStart() function

It sounds like a logical addition, you could request it at jamieechlin.atlassian.net/browse/GRV.

pass a parameter to a registered filter (for instance, is it possible to create a filter issueFunction in addedAfterSprintStart("BOARDNAME", <parameter>), and provide the parameter when calling the http request that generates the filter?

You can't really do that with JQL, short of programatically executing queries as mentioned earlier. It's not the easiest thing in the world to do but you can subclass com.onresolve.jira.groovy.jql.plugins.AddedAfterSprintStart and have it take a third param, or replace the second param, and then you generate the value for sprint and call the superclass. If I have time at some point I'll post some example code.

 

Cecile Chateau February 3, 2015

Hi, thanks a lot for your prompt response. Yes, the goal is reporting. I'm fine with your proposal of progamatically iterate through the projects (which is what I was trying to do with my loop to call the generic filters for all the teams, but maybe not at the correct level). But when you say "execute the query on last sprint or sprint-1", how can you programatically run the query if you don't know the name of the sprint for each team? (i mean each team is setting the name they want, so i can't deduce it) This is why I was asking if any keyword or specific JQL function existed, for instance sprint in closedsprints(BOARD NAME, -1, -5), which could mean all the issues belonging to the last 5 sprints for that board. Concerning the proposal "RemovedAfterSprintStart()", it seems I have a problem login in on jamieechlin.atlassian.net. My account seems to exist just fine since I receive the reset password email, but when I login, I'm still on the system dashboard without being logged in. any idea? regards cecile

JamieA
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 3, 2015

I presume you can get the sprints in the date order which they were opened or closed, and you can get the current active sprint(s), so you can work backwards...

Cecile Chateau February 3, 2015

ok i will try. thanks. any idea about my login problem on jamieechlin.atlassian.net so that i can submit the request to create "removeaftersprintstart()?

JamieA
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 3, 2015

I have no end of problems with Cloud. Can you try now please? I've manually added you to jira/confl.

Cecile Chateau February 3, 2015

i'm connected now, thanks a lot for your help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events