Skip to content

Commit

Permalink
Merge pull request #593 from roshanraj/patch-1
Browse files Browse the repository at this point in the history
fix(code-snippet): example jira ticket status update
  • Loading branch information
andygrunwald authored Nov 23, 2022
2 parents af9dc68 + dfa3565 commit 0946977
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ import (
)

func main() {
testIssueID := "FART-1"
base := "https://my.jira.com"
tp := jira.BasicAuthTransport{
Username: "username",
Expand All @@ -214,20 +215,20 @@ func main() {
panic(err)
}

issue, _, _ := jiraClient.Issue.Get("FART-1", nil)
issue, _, _ := jiraClient.Issue.Get(testIssueID, nil)
currentStatus := issue.Fields.Status.Name
fmt.Printf("Current status: %s\n", currentStatus)

var transitionID string
possibleTransitions, _, _ := jiraClient.Issue.GetTransitions("FART-1")
possibleTransitions, _, _ := jiraClient.Issue.GetTransitions(testIssueID)
for _, v := range possibleTransitions {
if v.Name == "In Progress" {
transitionID = v.ID
break
}
}

jiraClient.Issue.DoTransition("FART-1", transitionID)
jiraClient.Issue.DoTransition(testIssueID, transitionID)
issue, _, _ = jiraClient.Issue.Get(testIssueID, nil)
fmt.Printf("Status after transition: %+v\n", issue.Fields.Status.Name)
}
Expand Down

0 comments on commit 0946977

Please sign in to comment.