Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create burn-down charts for Kanban?

Ashutosh Bhonsle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 7, 2023

I am rather new to Kanban, most of my work experience is in SCRUM (time boxed sprints).

I am just not able to visualise how a burn-down can be generated when there is no time boxed sprint, let part the plugin to be used.

2 answers

1 accepted

2 votes
Answer accepted
Mark Markov
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 Champions.
October 16, 2018

Hello @Dennis S_

What is your jira version? Question mentioned by @Daniel Yelamos [Adaptavist] have some deprecated methods and may not work on lastest versions.

Here is another code example, without deprecated method:


import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.workflow.TransitionOptions
import com.atlassian.jira.config.SubTaskManager
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue
import org.apache.commons.lang3.StringUtils
import org.slf4j.Logger
import org.slf4j.LoggerFactory;

Logger log = LoggerFactory.getLogger("Subtask transition script")

//def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("RFA-467")
def
user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
SubTaskManager subTaskManager = ComponentAccessor.getSubTaskManager();
Collection<Issue> subTasks = issue.getSubTaskObjects()
log.error("Found {} subtasks of <{}> issue, starting transitions", subTasks.size(), issue.getKey())
if (subTaskManager.subTasksEnabled && !subTasks.empty)
{
IssueService issueService = ComponentAccessor.getIssueService()
CommentManager commentManager = ComponentAccessor.getCommentManager()
String comment = "Moving to *new status* status as a result of the *this transition* action being applied to the parent.";
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()

TransitionOptions transitionOptions = new TransitionOptions.Builder().skipConditions().skipPermissions().skipValidators().build()

subTasks.each {it ->
log.error("Try to transition subtask <{}>", it.getKey())
// In validateTransition method you should write transtion id, in this example 21
IssueService.TransitionValidationResult transitionValidationResult = issueService.validateTransition(user, it.getId(), 21, issueInputParameters, transitionOptions)
if (transitionValidationResult.isValid()){
IssueService.IssueResult issueResult = issueService.transition(user, transitionValidationResult)
if (!issueResult.isValid()){
String cause = StringUtils.join(issueResult.getErrorCollection().getErrorMessages(), "/")
log.error("Transition errors: {}", cause)
}
else{
log.error("transition issue <{}>, finished with result <{}>, adding comment", it.getKey(), issueResult.isValid())
commentManager.create(it, user, comment, true);
}
}
else{
String cause = StringUtils.join(transitionValidationResult.getErrorCollection().getErrorMessages(), "/")
log.error("Transition Validation errors: {}", cause)
}
}
Daniel Yelamos [Adaptavist]
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 Champions.
October 16, 2018

That is indeed a better way of doing it. Thanks Mark!

Dennis S_
Contributor
October 17, 2018

Hi @Mark Markov, Hi @Daniel Yelamos [Adaptavist],

 

thanks a lot for your prompt reply.

 

Looks like an appropriate solution. I have not yet had an opportunity to try it, but I will inform you as soon as possible (probably tomorrow).

 

Best regards

Dennis

Dennis S_
Contributor
October 17, 2018

The script works perfectly, @Mark Markov!

 

Thank you for your great support!

1 vote
Daniel Yelamos [Adaptavist]
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 Champions.
October 16, 2018

Hi Denis.

This question has already been answered here:

https://community.atlassian.com/t5/Jira-questions/Using-Post-function-script-to-Transition-Sub-Tasks/qaq-p/379790

It is very old though. Is it good enough to help you?

Cheers!

DY

Suggest an answer

Log in or Sign up to answer