Hi,
is it possible to set Next-Gen project private using the API? I haven't found any way to achieve that.
The following code does not work:
curl --request PUT --url 'https://dsprojects.atlassian.net/rest/api/3/project/[ID]' \
--header 'Authorization: Basic [token]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"isPrivate": "true"
}'
The "isPrivate" attribute is not recognized.
The strange thing is that the following code returns "isPrivate": "false" even though the project is private according to the Jira UI (Project Settings -> Details).
curl --request GET --url 'https://dsprojects.atlassian.net/rest/api/3/project/[ID]' \
--header 'Authorization: Basic [token]==' \
--header 'Accept: application/json'
Am I missing something here? Thanks
Hi @Jiří Koutný ,
I am adding a new answer since I have created a new Feature request for this issue and I have actually found a workaround to change a Next-Gen project access settings via REST API.
The feature request is the below one. Please vote and watch it so that you will be updated on the progress:
As you can read in the Workaround section of above ticket:
There is an internal endpoint that you can currently use to change the project access setting but this is not documented, not supported and it can change without prior notice: /rest/internal/simplified/1.0/projects/PROJECT-ID/summary
In order to change the access settings you have to sent a PUT request to the /rest/internal/simplified/1.0/projects/PROJECT-ID/summary specifying:
accessLevel: "OPEN", "PRIVATE" or "LIMITED"
avatarId: avatar id of the project
key: project key
name: project name
Example:
- Call https://XXXXX.atlassian.net/rest/api/3/project endpoint to get project info:
// https://xxxxxxxx.atlassian.net/rest/api/3/project { "expand": "description,lead,issueTypes,url,projectKeys,permissions", "self": "https://xxxxxx.atlassian.net/rest/api/3/project/10303", "id": "10303", "key": "TSMN", "name": "Test Scrum Migration NextGen", .....- change the access settings to the above project by sending a PUT request to https://xxxxxxx.atlassian.net/rest/internal/simplified/1.0/projects/10303/summary:
curl -u EMAIL:API-TOKEN -H "Accept: application/json" -H "Content-Type: application/json" -d '{"key": "TSMN", "name": "Test Scrum Migration NextGen", "avatarId": 10722, "accessLevel": "PRIVATE"}' -X PUT https://xxxxxxx.atlassian.net/rest/internal/simplified/1.0/projects/10303/summary {"returnUrl":"/browse/TSMN","id":10303,"key":"TSMN","name":"Test Scrum Migration NextGen","accessLevel":{"value":"PRIVATE","displayName":"Private","description":"Only people added to the project can create and edit issues. Issues in this project don't appear in search results.","iconName":"private"},"avatarId":10201}
I hope this helps.
Have a nice weekend.
Dario
The method from @Dario B still works like a charm! I have a webhook configured in Jira on 'Project Create', this connects to our automation platform (make.com), here we inject a ticket in Jira for IT support team to followup and finally we use the API call to set the project access to Private. It works on Jira software and Jira business (JWM) projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jiří Koutný ,
The value isPrivate returns true for any project in which the current user (the user account used to authenticate the REST API call) can’t browse issues.
In other words, that property just tells you whether you have permission to browse issues in the project and it is not intended to be used to set the Next-Gen project to private.
I hope this helps.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.