Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How do i modify the fields in a ticket and update using go-jira?

I am trying to fetch the request, update some parameters such as labels, assignee etc and push the same ticket i.e update it?

How do i do that in golang?

3 answers

0 votes
Plinkington _
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!
Oct 19, 2023

Found my way here looking for an answer, ended up looking through the existing test cases.
I assume it's something like this you want to do?

 

func TestIssueService_Update(t *testing.T) {
setup()
defer teardown()
testMux.HandleFunc("/rest/api/2/issue/PROJ-9001", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPut)
testRequestURL(t, r, "/rest/api/2/issue/PROJ-9001")

w.WriteHeader(http.StatusNoContent)
})

i := &Issue{
Key: "PROJ-9001",
Fields: &IssueFields{
Description: "example bug report",
},
}
issue, _, err := testClient.Issue.Update(context.Background(), i, nil)
if issue == nil {
t.Error("Expected issue. Issue is nil")
}
if err != nil {
t.Errorf("Error given: %s", err)
}
}
0 votes
Carlos Garcia Navarro
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2022
0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2022

Hi Kaushik - Welcome to the Atlassian Community!

I am not completely following what your need is. Can you provide more details about what you are trying to do? 

I am trying to modify the ticket from slack using slash commands.

Using go for the Rest purposes.

So I just need a way to do PUT operation to update the ticket(SLA, assignee, labels) etc

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events