I create issue so
IssueInputBuilder issueBuilder = new IssueInputBuilder( nameOutputProject, currentIssue.getIssueType().getId(), currentIssue.getSummary()); issueBuilder.setDescription(currentIssue.getDescription()); issueBuilder.setAssignee(currentIssue.getAssignee()); issueBuilder.setPriority(currentIssue.getPriority()); issueBuilder.setProjectKey(nameOutputProject); IssueInput issueInput = issueBuilder.build();
but IssueInputBuilder don't have method setStatus(). How to set issue status?
Community moderators have prevented the ability to post new answers.
You don't set the status of an issue in most cases.
If you're adding a new issue, you can (importing issues does this), but for existing issues, you should move the issue through the workflow, not set the status. Status is an indicator of where an issue is in the workflow, not a real "field".
I understood idea, but how to move the issue through the workflow programmatically?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use issueService.trannsition after issueService.validateTransition. You will find examples for these methods in Answers itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I find code
JiraWorkflow workFlow = ComponentAccessor .getWorkflowManager().getWorkflow(currentIssue); Status status = currentIssue.getStatusObject(); com.opensymphony.workflow.loader.StepDescriptor currentStep = workFlow .getLinkedStep(status); List<ActionDescriptor> actions = currentStep.getActions(); int actionId = 0; for (ActionDescriptor actionDescriptor : actions) { if (actionDescriptor.getName().equals("Start Progress")) { actionId = actionDescriptor.getId(); } } IssueService issueService = ComponentAccessor .getIssueService(); TransitionValidationResult transitionValidationResult = issueService .validateTransition(getLoggedInUser(), currentIssueId, actionId, issueService.newIssueInputParameters()); if (transitionValidationResult.isValid()) { IssueResult transitionResult = issueService.transition( getLoggedInUser(), transitionValidationResult); if (!transitionResult.isValid()) { // Do something } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alexander,
how said Nic, you cant set the Status, but you have to "do transition" in your workflow. In JSON si something like this:
{ "transition": { "id": "5" } }
So you have to put transition ID, to set Status field(for example REST API, but it's only example, because you are not using it: http://docs.atlassian.com/jira/REST/latest/#id109333).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you know how to do transition when use jira rest java client library?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can look at this: https://ecosystem.atlassian.net/browse/JRJC-76 . I think Transition or TransitionInput can do this magic(I'm using REST API not REST Client, so I don't know exactly how to do this).
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.