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

Creating project using REST API

Utthan Dharwa July 29, 2020

I am unable to creating a project using restAPI - https://<Your name>.atlassian.net/rest/api/3/project , Sending Username and Token as a Basic Auth.

My request Body is :

{  "notificationScheme": 10021, 

 "description": "Example Project description",  

"lead" : "name", 

 "url": "https://<yourname>.atlassian.net",   "projectTemplateKey": "com.pyxis.greenhopper.jira:gh-simplified-agility-kanban", 

"avatarId": 10200,  

"issueSecurityScheme": 10001,  

"name": "Example",  

"permissionScheme": 10011, 

 "assigneeType": "PROJECT_LEAD", 

 "projectTypeKey": "software",  

"key": "EX",

  "categoryId": 10120

}

 

Gettting this Response : {    "errorMessages": [        "'accountId' must be the only user identifying query parameter in GDPR strict mode."    ],    "errors": {}}

with 400 BAD REQUEST

1 answer

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2020

Hello @Utthan Dharwa

Welcome to the Atlassian Community!

The error you are facing is caused by the deprecation of usernames applied to improve privacy In Jira REST API, as described in the documentation below:

Deprecation notice and migration guide for major changes to Jira Cloud REST APIs to improve user privacy 

Since the implementation of the policies mentioned above, you can not reference users using Names or Usernames in Jira Cloud. Instead, you must reference his AccountId.

In your particular case, the error is returned because the "lead" field is deprecated. Instead, use the leadAccountId field to add the AccountId of your project lead, as described in the Jira Cloud REST API Official documentation.

P.S: To get the accountId of users, you can navigate to User management > Users > click on the related user and check its accountId at the end of the URL. Also, there is the following experimental REST API to get this information:

Get account IDs for users 

Let us know if you have any other questions.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events