Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to use 'project created' trigger with scheme ID condition

Dmytro Shaforost
Contributor
January 15, 2024

Hi, guys!

I need assistance with creating automation rule with 'project created' trigger, but I need to specify trigger conditions. Rule description: when project created with exact pre-configuration from other project (exact project) than do this actions.

As I understand I can use smart value with workflow scheme ID... But I can't find this smart value...

It would be great if somebody can help me with this or offer other decision 

1 answer

1 accepted

2 votes
Answer accepted
Mark Segall
Community Champion
January 15, 2024

Hi @Dmytro Shaforost - To my knowledge it is not possible to perform a native condition against a project configuration.  However, you could potentially use the Send Web Request action to create an API call to look for whether your new project has a specific configuration scheme.  For example, let's say I want to see if it has Workflow Scheme X, I could use this endpoint:

https://YOURINSTANCE.atlassian.net/rest/api/3/workflowscheme/project/?projectId={{project.id}}

Then you could use a an advanced/smart value condition against the results to see if the workflow scheme matches your business logic and proceed from there.

Dmytro Shaforost
Contributor
January 17, 2024

Hi, Mark! I don't so fluent in Jira automation for using ai requests in it, can you provide more details, please 

Dmytro Shaforost
Contributor
January 17, 2024

I mean that i can use web requests action, but I can't understand how to add authorization to it and how to use part of the answer in 'if' condition next

Dmytro Shaforost
Contributor
January 17, 2024

Trigger: Project creation

Action 1: see 1 screenshot? I try to get authorization parameters by first request, but I don't know how to handle it and use in next step

Action 2: I try to took requested authorization parameters to variables (how I can do this?)

Action 3: I  need to use authorization variables in new request which will give me a scheme ID 

Action 3: I need to use a part of the previous request with scheme ID for comparing conditions

Condition 1: How to compare created project scheme ID with answer in Action 3?

 

Sorry for many points and questions... Thanks for your support!

Screenshot 2024-01-17 124750.png

Mark Segall
Community Champion
January 17, 2024

Hi @Dmytro Shaforost - I don't see any screenshots attached. 

I would consider myself more of a novice with using the API, as I typically require a bit of trial and error to get my desired results, but hopefully this can point you in the right direction.  

Authentication - For testing purposes, I would use your personal account to create a token, but once you're done with testing, you'll probably want to shift to using a service account.  It requires an extra license, but is best practice.  This link should get you what you need for authentication:

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

Working with the Send Web Request action - I've found this article to be helpful:

https://community.atlassian.com/t5/Jira-Software-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Working with the results - To work with the response, you would want to use the Advance/Smart Values condition with something like this (note - I haven't tested myself, but this is where I'd start):

{{webResponse.body.name}}
Equals
YOUR WORKFLOW SCHEME NAME
Dmytro Shaforost
Contributor
January 17, 2024

Thanks for your answers, I would try to find a solution 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events