UpdateIssueStatus attempts to change the "status" field by finding a transition which achieves the desired state and then performing that transition
(client *Client, issueKeyOrID string, desiredStateNameOrID string)
| 454 | // transition which achieves the desired state and then performing that |
| 455 | // transition |
| 456 | func UpdateIssueStatus(client *Client, issueKeyOrID string, desiredStateNameOrID string) (time.Time, error) { |
| 457 | var responseTime time.Time |
| 458 | |
| 459 | tlist, err := client.GetTransitions(issueKeyOrID) |
| 460 | if err != nil { |
| 461 | return responseTime, err |
| 462 | } |
| 463 | |
| 464 | transition := getTransitionTo(tlist, desiredStateNameOrID) |
| 465 | if transition == nil { |
| 466 | return responseTime, errTransitionNotFound |
| 467 | } |
| 468 | |
| 469 | responseTime, err = client.DoTransition(issueKeyOrID, transition.ID) |
| 470 | if err != nil { |
| 471 | return responseTime, err |
| 472 | } |
| 473 | |
| 474 | return responseTime, nil |
| 475 | } |
no test coverage detected