Forums

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

Scriptrunner Behaviour updates issue immediately but time delay in filter

Pete P
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 Champions.
May 7, 2021

I am new to Scriptrunner so bear with me...  I am trying to set the value of a custom field based on the value of another custom field.  When I make the change to the issue I can see that the secondary field is updating, however I don't see this change for a while in my filters.  They still display the original field values.  Eventually they catch up.  Is there some sort of time delay in propagating these changes to the filters?  I don't really understand what is going on.  Here is my code:

 

 

def ClosureCode = getFieldByName("Closure Code")
def piReview = getFieldByName("PI Review")

def ClosureCodeValue = ClosureCode.getFormValue();
def piReviewValue = piReview.getFormValue();

log.error("TEST LOG BEHAVIOR")
log.error("Closure Code is "+ClosureCodeValue)
log.error("PI Review is "+piReviewValue)
log.error("TEST LOG BEHAVIOR")

if (ClosureCodeValue=="11314") //Successful set to N/A
{
    log.error("Successful closure code")
    (piReview=="11328")
    piReview.setFormValue("11328")
}

if (ClosureCodeValue=="11316") // Unsuccessful set to pending
{
    log.error("Unsuccessful closure code")
    (piReview=="11341")
    piReview.setFormValue("11341")
}


I am not sure which of the two methods is correct to set the value so i am using both.... 

1 answer

0 votes
Steven F Behnke
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 Champions.
June 14, 2016

Customers do NOT use the Notification Scheme. Customers will not be notified by events. 

Customers should be notified of ANY customer facing change. Have you verified that you aren't receiving this email?

Topicus
June 14, 2016

Hi Steven, thanks for your reaction. This has been verified. Lookin in detail in the notification documentation (URL listed in my orginal message) Atlassian states"

When a customer submits a request, they receive email notifications as the issue reporter when:

    • the request is created
    • a comment is added to the request
    • another participant is added to the request
    • the request is resolved with a set resolution field
    • the request is reopened with a cleared resolution field

So I concluded, status changes do not trigger messages. Strange for I recall this to work in SD 2.x.

Any other thoughts?

Steven F Behnke
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 Champions.
June 14, 2016

I saw the documentstion, but my point is still valid. If a customer facing change occurs (status changes from waiting on support to resolved) then the customer will receive and email. 

Perhaps the documentstion is misleading you. 

Topicus
June 15, 2016

Steven, the example you're describing aligns with the 4th documentation bullet I listed that does lead to a notification. (which also works on my end)

Do you have an instance where you do not set or clear a resolution but do a status change however, which in turn leads to a notification? plz clarify, and thanks again!

Suggest an answer

Log in or Sign up to answer