Hi Everyone,
I try to automate the creation of project in jira thanks to jira automation.
The user creates a ticket inside a specific project "Project configurator" to ask a new jira project.
The following fields are used to create the project:
1. Summary will be use as the project name
2. A customfield nammed "Project Leader" to add him inside the project leader on the new jira project.
3. Description
I create a automation with rest api call to create jira project, inside the automation:
1. I take the summary and use the function {{#issue.summary.toUpperCase().split(" ")}}{{left(1)}}{{/}} to get first letter of each words inside the summary to generate the project key
2. The summary will be the project name
3. I get the user id of user inside the project leader customfield and define as the jira project leader
4. I send rest api call to generate the project
If the jira key already exists, the api call is failed ... it's normal :)
So my idea is to check if the project key or project name already exist and to provide a new jira project key with a increment
Example:
I want to create a project with the project key = ABC
While the project key already exists new project key = new project key +1
And the final result of the new project key would be ABC1
And after to get the final key, I can launch API call to create project.
Do you know if I can have this kind of verification in jira automation?
Thank you
I find a api call to validate jira key.
I'll try this api call and let you know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Super-easy and lame approach: to test if the project FOOBAR exist, run the JQL:
id = FOOBAR-1
If it returns an issue, then the project exist. You get idea?
(Of course, FOOBAR-1 may have been deleted or maybe the FOOBAR project is empty, in those cases it won't work. But you could create some other JQL that works better in these edge cases.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Off course I thought to use a JQL to check if I found a issue with the key.
But my problem is to increment the key project and to check again automatically if the new key exists or not
First verification with JQL
id = FOOBAR-1
Jira finds the issue => my new key will be FOOBAR1
2nd iteration always with a JQL
id = FOOBAR1-1
Jira finds the issue ==> my new key will be FOOBAR2
3rd iteration
id = FOOBAR3-1
Jira doesn't find the => I can use this project key
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, OK, I misunderstood this a bit. I though you don't want to create the project if it already exists, but it seems you want to create it with the next available "counter".
Honestly, I don't think an automation rule will be able to do this...
(Using some Python/Groovy/JS script against the REST API, it should be straight-forward.)
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.