How can I put all bugs into current (started) sprint on creation using JJUPIN/JJUPIN Agile?

I can't find the script for doing this... Basically, if the issue type is "Bug" we want JIRA to automatically place it in the top started sprint. We usually have 2 sprints open at the same time (for at least a part of any given release), so this may not be easy. I want the bugs to go into the "next" sprint - the one at the top of my agile board.

I need this for multiple boards/multiple projects and would add it as a post-function.

2 answers

1 accepted

0 votes
Accepted answer

This is what I cobbled together from this:

number nextSprintInSprints=-1;
number brd = 35;

if (size(startedSprints(brd))>0)
 nextSprintInSprints=getElement(startedSprints(brd), 0);
if (elementExists(issueType,"Bug"))

In this case, the agile board number is stated so there has to be a separate script for each board/workflow.

It creates an error if there are no started sprints (not really a concern since we always have one going).

I will admit, I don't know what it is actually doing code wise - but added as a post-function to the Create Issue step, it adds any bugs to the sprint at the top of the agile board.

Hi Moriah,

You need JJupin Agile to do that. It comes with some useful routines that will help you doing this task like addIssueToSprint, startedSprints and more. Check them here:

Best regards,


Yes, we bought the addon last week. I can't figure out how to do this though. How can I find the ID of the next sprint (when we have multiple open sprints)? I can get a list of all started sprints, but how do I know what the next one is?


You will have to iterate through sprints ids returned by startedSprints/notStartedSprints(not sure if 'next' sprint is the 2nd started or 1st not started) and decide which one is the sprint you want. sprintInfo/sprintStartDate will help you for this task. It's not pretty, but it will do the job.

I understand that this is not simple enough, we will add some more helpful routines like firstFutureSprint for a board or a way to sort sprints.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

446 views 8 26
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you