JQL for value changed in custom field

jonatan.siden December 8, 2020

Hi,

 

I'm developing an integration between two platforms and need to connect issues in one system to Jira Cloud.

My solution for this integration is to create a custom field with webhooks that listens to "updates" on the field - if the field is empty, trigger a delete webhook, if the field is not empty - connect the issue to the recieving platforms issue (there is logic that I have developed that works for that).

My issue is that I cannot find any information about comparing the old value in the custom field with the new value (if it's different to the old value, the webhook should trigger).

What I want is something similar to Jira servers operator "CHANGED", but instead of needing to hardcode the values I want them to be dynamic:

The "CHANGED" operator is used to find issues that have a value that had changed for the specified field.

This operator has the following optional predicates:

  • FROM "oldvalue"
  • TO "newvalue"

 

With this I was thinking to do something like: "Name of my custom field" oldvalue != newvalue  
Any suggestions of what JQL I could use for this or any other method I can use to achieve this? I've checked the operator list for JQLs on Jira Cloud:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/

But havent found anything that fulfills my needs.

Thanks!

1 answer

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.
December 8, 2020

Hi @jonatan.siden  -- Welcome to the Atlassian Community!

As you note, the CHANGED operator only works for a limited number of fields, and not custom fields.  I do not believe you can do this with out-of-the-box JQL.  Have you considered investigating the marketplace for scripting add-ons?

Without getting into what your "integration" does, a work-around could be to use automation rules and another custom field to drive processing actions.  That is, the automation rule detects changes in your target custom field, and then sets a different custom field for what action to take.  Querying the action custom field for a specific value should be easy.


Best regards,

Bill

jonatan.siden December 9, 2020

Hi @Bill Sheboy  thank you alot for the answer. It works perfectly fine - I did actually not know that there were global automation rules available for us without adding any extra plugins! this is excellent! Thank you so much. Loving this feature already.

The only thing I'm missing right now is a condition that checks wether the value in my custom free text field changes to something other than what value was there before, as well as the field is NOT empty. Do you have any suggestions of how I can set this up?

 

Just like you say, I do have another field controlling wether the webhook is triggered or not, called "connect issue" (with choices yes or no, which I have now automated to trigger the "update webhook" if the choice is yes and the "delete webhook" if the choice is no. What I need now is "issue is update" = true and "connect issue" = yes, as well as the field changes to a newValue that not equals to oldValue.

Thanks!

Best regards,

 

Jonatan

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.
December 9, 2020

Hi @jonatan.siden 

Regarding detection of a custom field change, you probably aren't going to be able to do that with out-of-the-box JQL.

Have you looked in the Field Value Changed trigger in automation rules to see if your field is listed? That would be the easiest way to detect this, and then take action...perhaps all the way to triggering your webhook with just the one rule.

__Bill

Suggest an answer

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

Atlassian Community Events