Getting "This resource requires WebSudo" error while adding a new group to JIRA

Manali Malkani July 8, 2020

Trying to add new user, by posting user details in to REST API: POST /rest/api/2/group

This error is coming using Jira API in rest assured

 

Request

{
"id": "https://docs.atlassian.com/jira/REST/schema/add-group#",
"title": "Manali Group",
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"additionalProperties": false
}

 

Response

<status>
<status-code>401</status-code>
<message>This resource requires WebSudo.</message>
</status>

1 answer

0 votes
Dave Theodore [Coyote Creek Consulting]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2020

You need to manage cookies in order to do this via REST API.  Remember, in the webui, you need to enter your password before entering the admin area, right? That's what "websudo" is.  You can successfully pass websudo and capture the cookie, then reference the cookie when making your change.  It's easier to use the Jira CLI, though.

Manali Malkani July 10, 2020

I am already passing the session id value what else i need to pass here:

 

req=given().spec(Utils.requestSpecification())
.body(data.CreateGroup()).filter(session);

 

For all other request like create project, create issue this is the way it is working. Could you please help for this also?

Manali Malkani July 10, 2020

Using which statement i can successfully pass the websudo

Suggest an answer

Log in or Sign up to answer