Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assignee field while creating jira ticket fails with 400 #373

Closed
ptripathi-twilio opened this issue Mar 30, 2021 · 5 comments
Closed

assignee field while creating jira ticket fails with 400 #373

ptripathi-twilio opened this issue Mar 30, 2021 · 5 comments

Comments

@ptripathi-twilio
Copy link

Describe the bug

When I try to assign a ticket to some while creating it, zapi fails with 4000 bad request.

jira create API payload log looks like this:
"fields":{"assignee":{"Password":"","name":"svc.koalat-jira"},"issuetype":{"name":"Test"},"labels":["MyMy"],"project":{"id":"23432"},"reporter":{"Password":"","name":"fgvg.rtf"},"summary":"TestVoid"}}

but I get a 400 error with msg like this:

{"errorMessages":[],"errors":{"assignee":"Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."}

To Reproduce

create a ticket with assignee field as assignee

Expected behavior

should create the ticket

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • go-jira version (git tag or she): latest
  • Go version (go version): latest
  • Jira type (cloud or on-premise): on prem
@github-actions
Copy link

Hi! Thank you for taking the time to create your first issue! Really cool to see you here for the first time. Please give us a bit of time to review it.

@ghost
Copy link

ghost commented Apr 2, 2021

Assignee and Reporter need to be user IDs not usernames

i := jira.Issue{
		Fields: &jira.IssueFields{
			Assignee: &jira.User{
				AccountID: "userid",
			},
			Reporter: &jira.User{
				AccountID: "userid",
			},
			Description: description,
			Type: jira.IssueType{
				Name: JIRA_DETAILS.IssueType,
			},
			Project: jira.Project{
				Key: JIRA_DETAILS.ProjectKey,
			},
			Summary: summary,
		},
	}

@ctreminiom
Copy link
Contributor

It seems the user you're using to authenticate the call doesn't have the Assignable User permission or the fields are not in the Issue Create screen. @Dynatrace-Adam-Gardner the User ID (account-ID) is required only on the Cloud version, on Jira On-Prem is the Username value

manuelbcd added a commit to manuelbcd/go-jira that referenced this issue Apr 17, 2021
…porter by accountID instead of username since it is deprecated in Jira cloud
benjivesterby added a commit that referenced this issue Apr 17, 2021
#69 #373 example/create changed to use accountID intead of username
@manuelbcd
Copy link
Contributor

@benjivesterby, @andygrunwald I think this issue is resolved and can be closed

Best.

@benjivesterby
Copy link
Contributor

@manuelbcd Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants