This guide is designed to assist users in utilizing the Forms API to automatically submit or reopen forms.
If you need to handle multiple forms, please refer to the following article:
The request method will be PUT:
PUT https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}/action/reopen
- Your Cloud ID (not Org ID) is needed. Find it in the URL by visiting https://<instance>.atlassian.net/admin/jira-service-desk/portal-only-customers.
Tip: The Org ID appears as /o/ before the ID (e.g., https://admin.atlassian.com/O/<org_id>), while the Cloud ID appears as /s/ (e.g., https://admin.atlassian.com/S/<cloud_id>).
- Use smart values like {{issue.id}} or {{issue.key}} to dynamically add the issue ID or key.
- Access the formId using smart values such as {{issue.forms.formTemplateID}}.
{{issue.forms.formTemplateID}}
For more information about using forms smart values, please refer to the article below: - Using Forms Smart ValuesWatch the automation rule in action below:
The request method will also be PUT:
PUT https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}/action/submit
- Follow the same steps as above. See the automation rule in action below:
Note: Ensure the "Delay execution of..." option is enabled. This ensures the rule waits for the web request to complete before proceeding, which is crucial when the outcome affects subsequent automation steps.
Amazing article!
Great article, Proforma legend Bruno!
Great article.
However, I was successful only in my approval environment according to the image "Instance of Homologation.PNG". In the production instance, I made the same settings and I'm getting the 404 error as shown in the "Production Instance.PNG" image.
Since I'm site-admin I shouldn't have any permission restrictions, right?
And also the Token API was created over here: https://id.atlassian.com/manage-profile/security/api-tokens. That is, the Token API is linked to my email.
I've done several searches here in the community, but unfortunately I wasn't able to succeed in applying this rule to my production instance. Could you help me please?
Hey @Marcos Vinicius Araújo Silva
Thank you for your feedback!
I think we get resolved your use case at the ticket PCS-194234, but thanks for getting my attention on this I updated the article with the necessary clarification on the information about the Cloud ID, as you can see below:
- The cloudId will be your Cloud ID and not your Org ID. The easy way to get the cloud id is to go to https://<instance>.atlassian.net/admin/jira-service-desk/portal-only-customers. You will get the Cloud id in the URL (e.g.: https://admin.atlassian.com/s/<cloud_id>/jira-service-desk/portal-only-customers)
Tip: Don't get confused, the Org ID has a /o/ before the ID (https://admin.atlassian.com/O/<org_id>) and the Cloud ID has a /s/ before the ID (https://admin .atlassian.com/S/<cloud_id>).
Thanks and see ya next time!
Thanks a lot for the feedback. I ran the tests and it worked.
Thank you very much.
Hi, It works fine with 1 form per issue.
The smart value {{issue.properties."proforma.forms".forms.uuid}} provides all uuid's in the issue separated with a comma. The web request can't handle that. Is there a smart value with only the uuid of the explicit form that's being submitted?
Cheers, Pascal
Hello @Bruno Altenhofen ,
Great work with this article, however, I am having trouble making this work.
If you can lend me your expertise I would greatly appreciate it.
This is what I have done so far.
1. generated an API token
2. I encoded the credentials using base64. so far so good.
3. created the rule as you can see in the screenshots
the web method is a PUT with:https://****.atlassian.net/jira/forms/cloud/****/issue/{{issue.id}}/form/{{issue.properties."proforma.forms".forms.uuid}}/action/reopen
4. I am getting HTTP Status 405 – Method Not Allowed
The method received in the request-line is known by the origin server but not supported by the target resource.
Many thanks,
Florin
Hi @Florin have you managed to resolve the error:
HTTP Status 405 – Method Not Allowed
I'm getting this error too. Please help if you have any solution to this.Looking forward for your response
Warm regards,
Vimbanashe Chambara
Hi @CentricDataProjects
Unfortunately, I did not find a fix for it yet.
Still researching this, If I find something useful I'll comment here.
Thank you,
@Florin okay, thank you.
Has someone found a way to separate multiple entries in the {{issue.properties."proforma.forms".forms.uuid}} smart value?
im getting UUID,UUID as i have 2 forms
@Marco Grima
In an automation rule you should create a variable with the follwing syntaxis: {{#issue.properties."proforma.forms".forms}}{{#if(equals(name, "FormName"))}}{{uuid}}{{/}}{{/}}
After that you should create a Send web request with Authorization in the header and the URL https://api.atlassian.com/jira/forms/cloud/your-clou-id/issue/{{issue.id}}/form/{{variablename}}/action/reopen
Hey @Florin and @CentricDataProjects Thank you for your feedback and sorry for my delay in responding here!
So, I noticed from your screenshot that you are using in the "Web request body" the value "Issue data (Jira format)" and not the option "Empty". If you guys are still experiencing the error 405, could you kindly double-check if the option in the "Web request body" is "Empty"?
Please keep me informed!
Thanks!
Howdy everyone!
I've checked all the comments and noticed that there are some related to how to handle/manipulate forms separately.
Therefore, allow me to share with you this article that explains how to manage multiple forms separately:
Hi @Bruno Altenhofen I am also facing the same issue as @Florin and @CentricDataProjects
I am using Web Request body as "Empty" but still getting the same error - HTTP Status 405 – Method Not Allowed.
How to solve it?
Hi @Florin and @CentricDataProjects I actually fixed the issue now. I was using my endpoint instead of using https://api.atlassian.com/
My bad as @Bruno Altenhofen instructions were correct. Thank you, this is really great while https://jira.atlassian.com/browse/JSDCLOUD-10671 does not get implemented.
Hey @André Cohen Glad to hear that you were able to fix it, and thanks for your feedback!
Really helpful
Amazing Article as always!
We need this to be natively available in Automation for Jira itself, but great workaround!
Thanks @Ralph Gerald Varon
Hey, @Bruno Altenhofen , taking the question of @Pascal Suppers again, I'm in the same kinda of trouble:
"It works fine with 1 form per issue.
The smart value {{issue.properties."proforma.forms".forms.uuid}} provides all uuid's in the issue separated with a comma. The web request can't handle that. Is there a smart value with only the uuid of the explicit form that's being submitted?"
Could you help with these?
@Jael Carvalho see my solution at https://community.atlassian.com/t5/Jira-Software-articles/Submitting-or-reopening-a-Form-using-Automation-and-API/bc-p/2480255#M9620
Hi @Bruno Altenhofen,
Thankyou for this article.
I am trying to create this rule in my jira instance, but I am getting a 404 error. I have checked the url for the request multiple times. I have ensured that I am using cloud id in the url and not the org id.
I have tried with different API tokens. I have checked the permissions I have for the project and the issue. All looks good.
I have tried with a different url - something like below, and the rule is running without error in this case.
https://<jira_instance>/rest/api/3/customField/10287/option
But when I use the url in the below format, I get 404 error. -
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}/action/reopen
Are there any suggestions of the things I can try to resolve this error.
Thanks.
Hi @Bruno Altenhofen
Interesting solution.
My primary security concern is around the token. As a Site Admin, if I were to utilize a token generated with my ID, individuals with admin privileges in JSM could potentially gain unauthorized access to the system and misuse it for malicious purposes.
I am uncertain whether using a ServiceAccount token would yield similar results. While I have not conducted comprehensive testing on the entire solution yet, I intend to share my discoveries.
As a rule of thumb, it is strongly advised to use an Admin token under any circumstances, especially when hard-coded in a script available to other users.
Hello,
Dear community.
I tried everything I could think of to test it however, it did not work. I get a 405 error all the time.I tried to see all the differences in the screenshots of your conversation.I caught the differences in the “Web request URL” section between “API” and instance name.As well as in the “Headers” section between the key “X-ExperimentalAPI” and “Accept”.
I tried swapping these differences in various ways however every single one did not work.Two times I checked the “cloudID”, form uuid as well as API token encoded with base64.I am sure I have the correct data. Is anyone able to suggest me what to pay attention to?
I would be very grateful for your help.
Thank You
@Bruno Altenhofen The form ID smart value mentioned above did not work for me. What did was using the smart value {{forms}} to pull the formTemplateID.
The form ID code syntax that worked for me was
{{issue.forms.877a85d4-1450-4cbc-b02c-0b26ffde4f78}}
The entire call was
https://api.atlassian.com/jira/forms/cloud/{{your cloud id}}/issue/{{issue.id}}/form/{{issue.forms.877a85d4-1450-4cbc-b02c-0b26ffde4f78}}/action/reopen
Thank you so much for writing this article! It got me over the finish line on this rule!
Not working for JSM.
After two hours and quadruple checking the Cloud ID and Forms ID, I finally found the comment by @Cami Jara
@Bruno Altenhofenthank you for your guide! May I suggest a small improvement:Instead of
write something like
{{issue.forms.<formTemplateID>}}
It makes it clearer that you should insert the actual ID between the angle brackets, instead of using the Smart Value literally as shown, or pasting the Form ID without the Smart Value structure.
It looks like you're new here. Sign in or register to get started.