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

Need to create a new project every time when this automation rule runs.

Samuel Smiles P June 13, 2023

We want to create a new project when ever a issue is moved to In progress and we are doing that using automation and rest api and it is working fine. But the problem is we need dynamic ProjectKey everytime we run this rule. For project name and all we are using Smartvalues and it is working fine. What needs to be done for the projectKey?

 

Screenshot (900).png

3 answers

1 vote
Wolfgang -Litew8 GmbH-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2023

Hi @Samuel Smiles P 

You might look into this API. You can give it an example key (initial letters of your project name) and it will validate if the key is valid or generates a valid random string for the project key that is close to the key you tested. Sadly you cannot just give it a project name.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-key-and-name-validation/#api-rest-api-3-projectvalidate-validprojectkey-get

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2023

Hi @Samuel Smiles P 

Please review the documentation for that REST API function as it describes what is needed for the key attribute: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-post

If instead you are asking how to make the new key unique when you create the project, I recommend developing your own algorithm based on the project name (and perhaps some numbers) and use that consistently for key selection in new projects.

Kind regards,
Bill

Samuel Smiles P June 14, 2023

Hi @Bill Sheboy Thanks for your response.

The link which you have sent is for the Projects Type and Project Template but it is not generating a new Project Key. I need project key to be new unique every time this rule runs.Screenshot (903).png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2023

Correct, as I was noting this creates the project and the key generation would be independent of that.  Please see the other response for generation of a key.

bmccoy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2023

Hi!

You might be able to use some of the string manipulation functions we have to generate a key.  e.g.

{{issue.summary.replaceAll("[^a-zA-Z]","").left(5).toUpperCase()}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

Cheers,
Brydie

0 votes
Samuel Smiles P June 13, 2023

@Piotr Zadrożny _Eyzee_  Hi, This is my actual ask. Please let me know what needs to be done.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events