Forums

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

Using Automation Rest API to create/post new Automation Rules when a Project is Created

Fitzgerald, Jeffrey
Contributor
March 16, 2026

Recently came across the following Automation Rest API for managing Automation Rules.  I am working to create a new Automation rule when a project is created.  I have setup a Webhook that Posts to create the rule for the new project.  I have another rule I want to do the same with, but that Automation rule use smart values.  So when I try to use the Post Rest API to create it, it interprets the existing smart values as blanks.  Is there anything that I can do to pass those particular smart values as literals?  Tried various ideas from ASCII replacement and such, with no success.  Would appreciate any insights others have done.

1 answer

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 Champions.
March 16, 2026

Hi @Fitzgerald, Jeffrey 

Without seeing both the specifics of your rule-to-create-a-rule, and the dynamic JSON to create the message for the target rule...

I hypothesize you are encountering a racetrack timing problem.  The Send Web Request action is quite prone to this problem and it can "grab" the JSON for the message before it fully evaluates.  Occasionally, this throws an error due to invalid JSON, and other times, it just gets null data for the smart values in the message.  (The same thing can happen when using a dynamic URL for an endpoint call.)

One way to check for this cause is to create the dynamic JSON and store that in a created variable, perhaps named varJson.  This will force full evaluation of the expression before the rule proceeds.  Then, just use {{varJson}} as the message in the endpoint call.  This approach also helps with debugging as the entire expression can be written to the log to check it.

Kind regards,
Bill

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