Create project API questions

Hi. I followed this example I found on the web to create a project in a bash script via the REST api :
{
“key”: “EX”,
“name”: “Example”,
“projectTypeKey”: “business”,
“projectTemplateKey”: “com.atlassian.jira-core-project-templates:jira-core-project-management”,
“description”: “Example Project description”,
“lead”: “Charlie”,
“url”: “http://atlassian.com”,
“assigneeType”: “PROJECT_LEAD”,
“avatarId”: 10200,
“issueSecurityScheme”: 10001,
“permissionScheme”: 10011,
“notificationScheme”: 10021,
“categoryId”: 10120
}
Question 1: do I need to go into the database to find all these ids? For example, if I have a category called “cs4500”, how do I get the id programmatically?

Question 2: I create copies of a base permissionScheme and assign user groups to elements of a particular copy of a permission scheme. [I’ve been told by a knowledgeable user to use roles, but I haven’t understood that yet.] I need to do this - at least I think I do - because I want only specific users to have access to a particular project (I’m using jira in a class and I need walls between student efforts). I cannot find a way to create (duplicate and rename) a permissionScheme via the REST API.

Question 3: We spend a lot of time creating groups and adding users to groups. I’d like to do this programmatically via another script. Again, I cannot find any references on the web for doing this by the REST API.

Question 4: I’d like to undo all this good work by script too.

Thanks in advance for any help. I am setting up about 50 projects every semester and associating about 250 students each time. I’d like then to clean up the projects, permission schemes, groups, and users at the end of the semester. This is happening three times a year. Doing it by hand is slow, error prone, and painful.

Thanks,

Mike
1 Like

Hi @m.weintraub,

Welcome to the community!

I’m assuming that these are APIs for server? For more information on Jira Server APIs, please refer to this.

What particular tutorial were you referring here?

There is no REST API, AFAIK, to duplicate a permission scheme, however you can create one and other options with permission scheme and grants manipulation: api/2/permissionscheme

You can try:

Hope this helps.

Cheers,
Anne Calantog

1 Like