Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get all fields for jira automation?

Tacictus Anon July 18, 2024

Hello there,

I'm trying to send a web request with custom data which includes all the custom fields within an issue. My custom fields change between issues depending on type of issue (specified as a label). It's obviously possible to get the custom fields by name and use if-else depending on type, but this isn't particularly efficient.

Within the Issue Data option for the webhook body it provides fields data so this feels like it should be possible.

What would be perfect is if there were something like {{triggerIssue.fields}} (or equivalent).

Thanks.

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
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.
July 19, 2024

Hi @Tacictus Anon -- Welcome to the Atlassian Community!

When using Send Web Request in a rule to contain all supported fields in the issue, try sending the issue data in the web request body.  That is one of the options in the action.

To learn what smart values / fields are probably, currently supported, please use this how-to article and examine the fields shown: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

Please note I indicated "probably, currently supported".  I recommend experimentation to confirm which fields can be read or updated with rules.

Kind regards,
Bill

Tacictus Anon July 19, 2024

Hi @Bill Sheboy

Thanks for your reply.

Unfortunately the data has to be formatted in a specific way before being sent (has to have a certain JSON structure to be recognised), so sending the issue data as is wouldn't work.

I don't really need data outside of the 'details' and 'description' section within the issue, so any way to get that without having to know which individual fields to reference would be great.

Bill Sheboy
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.
July 19, 2024

As you have a defined structure needed, I believe you will need to hardcode it all or use inline conditions to selectively add the elements based on their presence / absence:

https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html

Tacictus Anon July 22, 2024

@Bill Sheboy Thanks, I see. That's a shame, it seems like a pretty basic feature that ought to exist.

2 votes
Nicolas Grossi
Banned
July 18, 2024
Tacictus Anon July 19, 2024

@Nicolas Grossi Thanks for your response. I've looked over the documentation and was unable to find a way of getting/listing all fields (or all custom fields) via a single smart value (although it's entirely possible I've overlooked something).

Is there anything in particular you think might help in this situation?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events