Jira Forms: How to reopen a form submitted automatically

Aslıhan Paksoy June 13, 2022

Hi,

We are using Jira software. I have been testing the new Forms feature.

And I could not find a way to reopen a submitted form when the issue's status changes.

We have Jira Automation and JMWE, I can get the form properties like this

jmwe form.jpg

But I need to reopen this form when issue is transitioned. Any ideas?

 

Thanks,

5 answers

1 accepted

0 votes
Answer accepted
Jennifer Luo September 13, 2022

Found a solution to this - you'll need to setup a few things:

1. GET request to find the global issue ID

https://<<your site here>>.atlassian.net/rest/api/2/issue/{{issue.key}}

ID: {{webResponse.body.id}}

2. PUT request to unlock the form

https://<<your site here>>.atlassian.net/gateway/api/proforma/cloudid/<<your cloud id>>/api/3/issue/{{id}}/form/<<form number>>/unlock

The form number is the order in which the form was attached, e.g. if the form was the second form attached, then this number should be 2

Aslıhan Paksoy October 19, 2022

Hi Jennifer,

 

We dont have scriptrunner, we just have jmwe. Are you familiar with it? If so, could you be more specific, because I am not sure how to implement this and I have never used Rest api.

Like Raphael Lopes likes this
Raphael Lopes October 28, 2022

Hi Jennifer.

 

This is a web request in automation?

Jennifer Luo November 1, 2022

Aslihan / Raphael,

This is a web request in automation. Unfortunately, I haven't used JMWE before.

Like Raphael Lopes likes this
robert cortez November 3, 2022

Is this process allowing you to reopen forms for additional editing? That is the functionality my project needs for forms at the moment. 

Like Raphael Lopes likes this
MaximeH November 15, 2022

Hi Jennifer, are you suggesting to create two web requests in Automation ? One for the GET and one for the PUT ? I'm trying your solution but not sure exactly how to structure it.

Thanks !

MaximeH November 15, 2022

Nevermind ! I found out how to do it.

You have to create 2 web requests one after another

1) Get

Web request URL : /rest/api/2/issue/{{issue.key}}

(dont forget the authorization in base 64 : email:apitoken)

2)Put

Web request URL :

gateway/api/proforma/cloudid/"siteid"/api/3/issue/{{webResponse.body.id}}/form/1/unlock

Like Raphael Lopes likes this
robert cortez November 16, 2022

So this process works to reopen forms after a customer has submitted/saved? Want to get a clear idea of what function is actually happening before I invest time into learning this and implementing it. 

MaximeH November 16, 2022

Yes, that's the way to reopen a form

Carlos Florit Navarro November 22, 2022

The GET part works, but PUT is throwing a 404 error. I'm using JSM Cloud.

MaximeH November 22, 2022

Did you correctly replace site id ?

Don't forget to select Delay execution of subsequent rule actions until we've received a response for this web request in the 1st rule also

Carlos Florit Navarro November 23, 2022

According to Atlassian this solution works when forms were ProForma but integrating them into Jira Service Management required changes that seem to make this option not viable.

Jennifer Luo December 4, 2022

This still works now, it's just that the API is slightly different compared to before - I've also realised you can pull the issue ID directly using smart values, so it saves you a second API call:

https://<<your site here>>.atlassian.net/gateway/api/proforma/cloudid/<<your cloud id>>/api/3/issue/{{issue.id}}/form/<<form number>>/unlock

The easiest way would be to open Developer Tools in your browser (F12), unlock your form and get the cloud id from the PUT request you see there.

Like kunj Patel likes this
Stefan Heinrichs February 13, 2023

Is there a possibility to validate whether a form/<<form number>> exists?

Jennifer Luo March 28, 2023

If it doesn't exist, i.e. say you only have 2 forms but you call the api using value 3, the response will be 404 not found with the following payload:

{
    "error": "notFound",
    "context": "err.entity.form",
    "contextId": "10"
}
Christine Corona May 16, 2023

@Jennifer Luo I created the automation as you described on 12.04.22 as a GET and it works fine, however it is not unlocking the form. I tried to change the GET to POST, and even PUT but I get an error 'method not allowed'. I'm well aware it's user error as I'm not great with API requests. Could you tell me what the final piece is that I need to do so that the automation acutally unlocks the form for a customer on the portal to edit? Thanks so much!

Screenshot 2023-05-16 141516.jpg

Jennifer Luo May 16, 2023

@Christine Corona please try this image.png

Christine Corona May 18, 2023

@Jennifer Luo when I change it to the GET request you referenced I get a 404 error

Jennifer Luo May 18, 2023

sorry, missed the GET - change that to a PUT

Christine Corona May 19, 2023

@Jennifer Luo still didn't work. I'll keep trying to figure out the issue, thanks.

Screenshot 2023-05-19 094529.jpg

Jennifer Luo May 24, 2023

Hi @Christine Corona

Make sure you have your Authorization header details correct, I don't see anything else that could be missing!

Also make sure there is in fact a form attached to the issue - if not, it will not work since nothing is going to be unlocked.

Christine Corona May 25, 2023

@Jennifer Luo  I finally for it to work, and yes part of the error was my authorization header, thank you for all your help!

1 vote
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

For future reference this is the URL you should use (as of 13/02/2023):

PUT {{baseurl}}/gateway/api/proforma/cloudid/{{cloudId}}/api/3/issue/{{issue.id}}/form/1/reopen
Stefan Heinrichs May 17, 2023

Is {{cloudId}} a working smartValue now? Or did you just write that to stay in the syntax?

Jennifer Luo May 17, 2023

cloudId is not a smartValue from what I know, that is still something you need to grab yourself

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

It is not, but it also does not change. So you can hard code it in the URL. 

1 vote
Jennifer Luo June 13, 2022

+1, we are also having issues and can't find a workaround

0 votes
Christine Corona May 16, 2023

@Aslıhan Paksoy Would you be willing to share screenshots of how you set up your Jira Automation?

Thank you!

Apologies entered on wrong thread

0 votes
Aslıhan Paksoy April 17, 2023

Hi Jennifer,

I have tried your solution with Jira Automation and it worked like a charm! Thank you!

Jennifer Luo May 1, 2023

No worries! happy to help :)

Christine Corona May 16, 2023

@Aslıhan Paksoy Would you be willing to share screenshots of how you set up you Jira Automation?

Thank you!

Suggest an answer

Log in or Sign up to answer