Forums

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

Hi..I am trying to use lookupIssues functionality to do automation. I can't get customfield

Deleted user January 11, 2024

Hi.

 I am using lookupIssues functionality to do automation. I can't get customfield value to display in email automation.Is there any workaround to do the same..Afaik we can't get customfield value as per jira Data center limitation. Any help would be much appreciated 

Thanks

3 answers

1 accepted

1 vote
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.
January 11, 2024

Hi @[deleted] 

Custom fields are not yet supported for Lookup Issues with Jira Server / Data Center.  Here is the suggestion to add those: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

For some background, when Lookup Issues was first added for Jira Cloud, it also only supported about a dozen fields.  About a year later, all of the other fields were added.  Perhaps the same will happen for the non-Cloud versions.

As a work-around, you could call the REST API issue search with JQL, using the Send Web Request action, and that will probably include all of the fields.

Kind regards,
Bill

Deleted user January 11, 2024

@Bill Sheboy Thanks..yes I am aware of the limitations..Thanks for the workaround..I got 5 issues from lookup and I want to mention them in email content..how to make use of rest API for each issue..I think we don't have options to iterate through lookup issues to find info for a each and every issue.

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.
January 11, 2024

When using Send Web Request this way, the response contains the issues with their fields, the same as with Lookup Issues and so may be iterated over.  The difference is referencing the {{webhookResponse}} rather than {{lookupIssues}}

Please look see this how-to article for calling the Jira REST API functions from a rule:

https://community.atlassian.com/t5/Jira-Software-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Depending upon which function you call, the response will be different.  I recommend writing a test rule to call the REST API function, and writing the response to the audit log.  That will show the structure to help iterate over it in the email.

Deleted user January 12, 2024

@Bill Sheboy Thanks..I have 4 issue filtered out by jql and I want to send them in single email with customfield value. Webhook is sending into 5 different email.

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.
January 12, 2024

Would you please post an image with your complete rule and of the audit log details showing the rule execution?

Until we see that...

I suspect your rule is trying to branch over the issues, rather than using the webhook response as a set of issues for the email.

Deleted user January 12, 2024

@Bill Sheboy Not sure I am getting it..I am very new to jira :(. Is it possible to share the flow to implement to have a try.

When :Scheduled every 1 days

Then Lookup issues

Search for issues using JQL

project=test

And Send Web Request

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.
January 12, 2024

Please try adjusting to this, without the lookup issues action (if you need the custom fields)

  • trigger: scheduled with no JQL
  • action: Send Web Request, to get the data with the REST API call and JQL
  • condition: check the response of the request was successful
  • action: send email, using the {{webhookResponse}} data to access the issues
Deleted user January 12, 2024

@Bill Sheboy Thanks..I was able to move till condition and response was 200.

I printed {{webhookResponse.body}} in log action.

 Log action
Log
Test: {expand=schema,names, startAt=0, maxResults=50, total=2, issues=[{expand=operations,versionedRepresentations,editmeta,changelog,renderedFields, id=83503, self=https://jira.testserver.com/rest/api/latest/issue/83503, key=PM-109}, {expand=operations,versionedRepresentations,editmeta,changelog,renderedFields, id=58076, self=https://jira.testserver.com/rest/api/latest/issue/58076, key=PM-107}]}
Associated items:
None

 I am not able to print data from webhookResponse. 

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.
January 12, 2024

Have you tried iterating over the issues, such as with this:

{{#webhookResponse.body.issues}}
access your fields by the smart values
{{/}}
Deleted user January 12, 2024

@Bill Sheboy yes..tried..

This doesn't works.

 {{#webhookResponse.body.issues}} {{issue.key}} {{/}}

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.
January 12, 2024

Once inside of an iterator, do not add the issue prefix as the scope is the iterator (not a single issue).

 {{#webhookResponse.body.issues}} {{key}} {{/}}

Like Deleted user likes this
Deleted user January 12, 2024

@Bill Sheboy Thank you...what about customfield value...will it be customfield_198.value

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.
January 12, 2024

This depends upon the field type...

  • For number and text, just use the custom field id, such as: {{customfield_12345}}
  • For a select list, add the value attribute: {{customfield_12345.value}}

I am using Jira Cloud, and not Server / Data Center, so please check your field type and attributes to confirm them.  This how-to article can help with that: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

Deleted user January 12, 2024

@Bill Sheboy Thank you so much...yes I was able to figure out that .since it's drop down then I had to get using value .I really appreciate your support 🙏

Like Bill Sheboy likes this
0 votes
Tansu Akdeniz
Community Champion
January 11, 2024

Hi @[deleted] 

Welcome to the community.

Which limitation do you mean?

This format is used to get custom field value: {{issue.customfield_xxxxx}}

Jira smart values - issues

If you mean something different, please share more details.

Deleted user January 11, 2024

Thank you. Here is the snippet and it works well except customfield



<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} -{{fixVersions.name}}</a> - {{summary}} -{{status.name}} -{{customfield_16961.value}}</li>{{/}}
</ul>

0 votes
Jack Brickey
Community Champion
January 11, 2024

it would be great to see a screenshot of your rule. Please include details of the given components where you are struggling.

Deleted user January 11, 2024

Thank you..I am using this.



<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}} -{{fixVersions.name}}</a> - {{summary}} -{{status.name}} -{{customfield_16961.value}}</li>{{/}}
</ul>

 

Other than customfield everything works and I can see in log action.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events