Hello dear friends,
I'm stuck on groovy development about boards (rapid views), and more precisely on swimlanes.
I'm trying to add programmatically a new swimlane in my board.
For this, I found these classes:
Here is my current code (it doesn't work at all):
import com.atlassian.greenhopper.model.rapid.RapidView
import com.atlassian.greenhopper.model.rapid.Swimlane
import com.atlassian.greenhopper.model.rapid.Swimlane.SwimlaneBuilder
import com.atlassian.greenhopper.service.rapid.view.RapidViewService
import com.atlassian.greenhopper.service.rapid.view.SwimlaneService
import com.atlassian.greenhopper.service.rapid.view.SwimlaneServiceImpl
import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
@JiraAgileBean
RapidViewService rapidViewService
def authenticationContext = ComponentAccessor.jiraAuthenticationContext
def user = authenticationContext.loggedInUser
def view = rapidViewService.getRapidView(user, 11014).get() // ID of board - you can see that in the URL
def swimlaneService = new SwimlaneServiceImpl()
log.debug swimlaneService;
log.debug view
allSwims = swimlaneService.loadSwimlanes(view)
for (swim in allSwims){
log.debug swim.toString()
}
def newSwimBuilder = new SwimlaneBuilder()
newSwimBuilder.name("New swimlane")
newSwimBuilder.query("'parent link' = KEY-1")
newSwimBuilder.position(2 as Integer)
def newSwim = newSwimBuilder.build()
log.debug newSwim.getId()
log.debug newSwim.getName()
log.debug newSwim.getQuery()
log.debug newSwim.getPosition()
swimlaneService.add(user, view, newSwim)
Honestly, ...
1. I found how to instantiate "rapidViewService" and it works, but I don't even understand how and why, first time I see this "@JiraAgileBean"... But nevermind. It works. But if you have time to explain to me what is this...
2. With SwimlaneService, I have the following error, after trying to access all swimlanes (loadSwimlanes(RapidView)) and I don't know why:
2022-07-22 16:11:20,224 ERROR [common.UserScriptEndpoint]: Script console script failed: java.lang.NullPointerException at com.atlassian.greenhopper.service.rapid.view.SwimlaneServiceImpl.loadSwimlanes(SwimlaneServiceImpl.java:84)
3. I found the "SwimlaneBuilder" and i can populate some fields (name, query...) but I don't know how to save it (and then, how to have a valid id for this new swimlane).
I'm pretty far from my goal.
Please, help me if you can!
Thank you so much <3 love on you.
Oliv'
Have a look through https://confluence.atlassian.com/enterprise/jira-sizing-guide-461504623.html
Your VM is unsuitable though - you need a fast *local* disk to put the intex on, SAN attached storage is too slow.
Dear Nic,
We are categorized as small-scale. Do you think that the features of our current server is too slow for such category?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know, you've not told us how much memory you've got.
But it probably is, as you only need 1Gb heap space for a small server.
You just need to get a fast local disk attached and you'll be fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.