As a workaround for https://jira.atlassian.com/browse/JSDCLOUD-10657, I would like to add a comment when a form is submitted with the form name and the user who submitted the form. I can use {{initiator}} for who triggered the Form Submitted automation rule, but I can't find any documentation with a smart value of the form name.
There isn't a smart value for the form name, but {{forms.last}} will get you the form template Id associated with the form that was last submitted. Depending on how many forms you have you could then have a lookup table that contains the form template id an the name of the form. To know what the form template id is for a specific form, go to Forms and click on the three dot menu and then select Copy form ID.
Your other option is to use the Forms API to get the list of forms on the work item and compare the Ids returned with the one returned by {{forms.last}}.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mikael Sandberg this would be functional (though far from ideal) if it worked as you've described. Unfortunately {{forms.last}} is returning a different ID with each submission of the same form.
Just a guess, but it appears that this is more a submission GUID than the form ID. I've also posted on the article you linked, so hopefully Bruno can provide a new smart value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anybody that stumbles across this post, here is a work-around if {{forms.last}} still isn't working as expected:
1. Send the following GET Web Request as defined here. This method "Gets a list of forms on the issue with basic metadata about them". Ensure you check the 'Delay execution of subsequent actions' box.
https://api.atlassian.com/jira/forms/cloud/[your-cloud-id]/issue/{{issue}}/form
2. Use the following smart value in a comment or however you need to return the last form name:
{{webResponse.body.get(webResponse.body.size.minus(1)).name}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for describing your workaround, and...
After the endpoint call, it seems you are getting the last entry, and so a list function could be used rather than performing the math with get():
{{webResponse.body.last.name}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In addition to what @Mikael Sandberg stated, here is an other reference link from Atlassian on Form smartvalue usage -
https://community.atlassian.com/forums/Jira-articles/Using-Forms-Smart-Values/ba-p/2888967
Hope this also helps.
Best, Joseph Chung Yin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.