Jira Service Managementで自動化ルールを作成して、フォームフィールドの値を取得しようとしています。現在、UUIDが指定されている場合、次のスマート値を使用してフィールド値を取得できます:
{{issue.forms.."フォームフィールド名".label.first}}
さらに、次のスマート値を使用してUUIDを動的に取得できることを確認しました。
proforma.forms".forms.first.uuid}}
しかし、動的に取得したUUIDを組み合わせてフォームフィールドの値を取得するのに問題があります。たとえば、次の試みは期待どおりに機能しませんでした:{{issue.forms.{{issue.properties."proforma.forms".forms.first.uuid}}."PCRequired".label.first}}
また、REST APIを使用してフォームフィールドの値を動的に取得することも検討しています。誰かが特定の手順やコード例を提供していただければ、非常に役立ちます。以下のようなAPIエンドポイントの使用を検討していますが、詳細がわかりません:
https://api.atlassian.com/jira/forms/cloud/{cloudid}/issue/{{issue.キー}}/form/{{issue.properties."proforma.forms".forms.first.uuid}}/field/FormFieldName
どなたかこの問題を解決する方法を知っているか、提案する具体的なアプローチをお持ちの方がいらっしゃいましたら、ご指導いただければ幸いです。
Hi @川目 沙英 ,
The most reliable way to get form field values is to use the end point:
GET Get form simplified answers
I've tried other methods (e.g. issue properties), but they are not reliable. Especially when you change the form or the form has too many fields & sections.
With the response you get from the API call, you can create a lookup table for each answer you are interested in and use that throughout your rule.
GET Get form simplified answers
Is it possible to specify a specific form field with this endpoint and get its value?
I'm also trying to create a lookup table using the response I get from the API call based on your advice.
I'd also like to know about a smart value that will get the "answer" that corresponds to a specific "label".
The method below didn't work for me, is there any other suitable way?
{{webResponse.body..[label="job title")].answer}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To create a lookup table, first create a variable:
Variable name: response
Smart value: {{webResponse.body}}
Then create the lookup table and use the regex below to find the answer:
Lookup table variable name: answers
Key > Value
Short description > {{response.match("\{label=Short description.*?answer=(.*?)[,|\}]")}}
Location > {{response.match("\{label=Location.*?answer=(.*?)[,|\}]")}}
With the lookup table you can use:
{{answers.get("Short description")}
In the rest of your automation rule.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is only one associated form.
But the trigger will be when the issue transitions.
Is it possible to use {{forms..fieldname.label.first}}?
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.