How do i get the original value of the Priority field using Jira Behaviors?

Andrew L August 14, 2017

Hi

I have this code snippet:

def origPriority =  underlyingIssue?.priority.getName()      
log.debug(String.format("orig priority is %s", origPriority))
                                                                 

When i change the priority in the Jira UI, i expected the logfile to show me:

   orig priority is <the-original-priority>

Instead, i'm getting the changed/new priority.

So how can i get the original value of the Priority before the user changed the priority?

 I need to know if the user has changed the priority and take appropriate action if necessary.

Thanks

--Andrew

 

 

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Daniel Yelamos [Adaptavist]
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.
August 15, 2017

Hi Andrew. Alaeksander is right. That should work.

"underlyingIssue" is the object that the DB currently has before it is updated by your form. 

Can you tell me how you have setup your behaviour?

Cheers

Dyelamos

Andrew L August 22, 2017

Daniel,

It looks like there's a problem with my test instance of Jira (or the Jira Behaviors plugin running on the test instance of Jira).

I was able to get my logic working properly on another instance.

Thanks

--Andrew

Suresh Srini December 15, 2020

Hi,

I am trying to read selected priority field value on the screen for my process. can you shar the steps or code here?

0 votes
Aleksandr Zuevich
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.
August 15, 2017

Hi Andrew,

I've tried your snippet and always get the original priority (I change the priority in the edit issue dialog).

Andrew L August 22, 2017

Aleksandr

It looks like there's a problem with my test instance of Jira (or the Jira Behaviors plugin running on the test instance of Jira).

I was able to get my logic working properly on another instance.

Thanks

--Andrew


TAGS
AUG Leaders

Atlassian Community Events