Fill in ProForma forms programatically

Adrian Citu December 17, 2021

Dear community,

 

I start by giving some context: I would like to create a script that will create jira tickets combined with a form.

Using the Jira API I was able to create a ticket and also I was also to create and attach a ProForma form to the ticket.

Now, I want to fill in programmatically the form fields before submitting the form (which is possible using the Proforma Rest API).

The problem is that I did not found any Rest api to fill in the form programmatically.

I've seen also that the forms are part of the issue properties; for ex /issuse/xxxxx/properties/proforma.forms.i1.

I have tried to get the json representing the form from properties, to modify it by  injecting in the json the fields values for the from and put it back. It does work from the API point of view but when i refresh the ticket in the browser, the form had disappear.

I don't think this is the way to go because i see that the form have also a hash field.

 

Any idea to fulfill this is more than welcomed.

thx,

Adrian 

 

 

1 answer

1 accepted

0 votes
Answer accepted
David Bakkers
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.
December 17, 2021
Adrian Citu December 18, 2021

Thx for your answer.

In the ProForma Rest api there is no api entry to fill in a form, just to create a form, get the answers and submit.

it sounds weird but it's true.

Adrian

David Bakkers
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.
December 19, 2021

According to this ProForma documentation, you can link a question on a form to a custom field in Jira.

Have you tried that method, then use Jira's REST API to update those custom fields for that issue and hence update the corresponding questions in the form for that issue?

Adrian Citu December 21, 2021

Thx for the reply; indeed I have tried this manually and it works.

Most probably can be done also programmatically.

So the solution is to link the form fields to custom fields at design time of the form, then when the jira ticket is created, this custom fields are filled in and when the form is attached to the ticket automatically the form fields are filled in (because are linked to the custom fields).

 

thx,

Adrian

David Bakkers
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.
December 21, 2021

No problem.

Now that ProForma has been acquired by Atlassian, the REST APIs will probably merge and that 'double handling' of the fields will might be phased out.

Might be :)

Marc Rominger July 13, 2022

Can someone explain this in detail? I am able to access the Jira API to create a ticket and i filled the mandatory fields. Then i try to call 

/rest/proforma/1/issue/$JIRA_KEY/form/$REQ_NO/submit"

but my ticket gets closed immediately , because it wasn't created through ProForma

Suggest an answer

Log in or Sign up to answer