Forums

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

Unable to update customer health field with automation

Adam Hasselgren January 18, 2023

I've created a customer health field and wanted to update it via automation using JQL and lookupissue actions.  I think I've solved everything except seeing the value and updating it.  I've tried quite a few different formats using the audit log action but everything comes up blank.

 

Here are the things I've tried logging

 

{{IssueCustomerHealth}} - this is a variable name I created using the smart value of {{issue.Customer Health[Dropdown]}}

{{issue.Customer Health[Dropdown].displayName}}

{{issue.customfield_10163}}

{{issue.customfield_10163.displayName}}

Screenshot 2023-01-18 at 8.57.41 AM.png

 

Any ideas as to what needs to be the proper naming for the field?

 

1 answer

0 votes
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 18, 2023

Hi @Adam Hasselgren 

You can do that with the selection field's id or name, such as {{issue.customfield_10163.id}} or {{issue.customfield_10163.name}} as described here:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

If that does not help, please post images of your complete rule and the audit log details showing the rule execution.  Those will provide context for the community to offer suggestions.  Thanks!

Kind regards,
Bill

Adam Hasselgren January 18, 2023

Thanks for the reply Bill!  So now I'm having another issue trying to lookup and update a single record..

I created a unique Customer "XYZ" and a single Task with "XYZ".  When I validate the JQL it sees the one record.  After it runs it says it's not seeing per the logs.  Any idea?  

 

Screenshot 2023-01-18 at 10.37.41 AM.pngScreenshot 2023-01-18 at 10.35.48 AM.png

Screenshot 2023-01-18 at 10.40.19 AM.png

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 18, 2023

Thanks for that information and screen images.

Is this rule defined in project "A20", in another project, or in a global scope?

Adam Hasselgren January 18, 2023

Only A20

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 18, 2023

That is curious...Is this a company-managed or a team-managed project?

Let's try this to see if the rule is "glitched", which seems to happen after too many rule publishes/edits: recreate your rule from scratch as a new rule, and then retest.

Adam Hasselgren January 18, 2023

company-managed and I'm actually creating a new one as we speak with a different trigger (currently: manually triggered change to: scheduled).

 

No idea if that will fix it but I don't see any other issues.

Adam Hasselgren January 18, 2023

No luck.....Is there any other type of function I could use?

 

Basically I would like to cycle through a group of issues, and update a field based upon the value of another on.  The problem I'm having is it's not even getting to the action condition. 

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 18, 2023

I was going to suggest trying a scheduled trigger, and you have already tried that.  I did a quick look and did not see this symptom in the public Jira backlog.

Let's fault isolate this a bit...

The symptom is the rule editor indicates your JQL statement is both valid and returns an issue, and when the rule executes it finds no issues.

Some additional things to check would be: 

  • which user is the rule actor and does it have permission to view issues?  The default rule actor of "Automation for Jira" normally has this, unless it was changed.
  • when you run that JQL stand-alone in advanced issue search, what do you see: the one issue you expected?
  • are there multiple fields with that same custom field name, perhaps in both company-managed and team-managed projects?
Adam Hasselgren January 19, 2023
  1. Automation for Jira
  2. Yes, I see a single issue, the one I was expecting 
  3. I verified there is no other field called customer.  In addition I changed fields like "Customer Health" to "Customer_Health" just in case.

 

I also decided to modify my logic a little bit in case there was an issue with the color icon.  I changed it to where if on my "Customer" artifact I created a new field called CH_Hidden.  Basically it's a text field storing Red, Yellow, Green.  If the "Customer_Health" field changes (the stoplight icons), then it updates my hidden field that contains text.  I thought maybe this would help for updates.

I created the same CH_Hidden field on Task, and manually added the value of "Green". (trying to isolate the JQL searching issue)

Screenshot 2023-01-19 at 10.20.51 AM.pngScreenshot 2023-01-19 at 10.21.06 AM.pngScreenshot 2023-01-19 at 10.23.09 AM.pngScreenshot 2023-01-19 at 10.23.49 AM.png

 

As you can see a normal search with the same JQL shows the single result however the log shows "No related issues could be found."

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 19, 2023

Okay, one more thing to check...

Using your example issue of A20-3271 follow the instructions in this how-to article to call the REST API for your issue.  Basically you are just getting all of the supported smart values for a specific issue: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Now check that the field's smart value exactly matches your JQL and what the value is that you see for the selection.  It is possible the value to match on may not be Green.

If that does not help uncover this one, my recommendation is to contact Atlassian Support to submit a ticket so they can take a look.  You appear to be the site admin of a paid Jira license and so can do that here: https://support.atlassian.com/contact/#/

Once you hear back from them, please post what you learn to benefit others.  Thanks!

Adam Hasselgren January 20, 2023

Looks like it does have a value of "Green"

 

Screenshot 2023-01-20 at 10.18.43 AM.png

 

I will submit a ticket to Atlassian Support and see if they have any ideas.  Thanks for all your feedback and will keep everyone posted in here!

Like Bill Sheboy likes this
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 20, 2023

Thanks.  One more thing to try: put "Green" in quotation marks in your JQL statement.

Adam Hasselgren January 20, 2023

No luck :(

 

Screenshot 2023-01-20 at 10.26.31 AM.png

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 20, 2023

Oh well...onward to the support team!  :^)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events