Forums

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

Jira expression to find Previous Status

Majo Francis _MicroGenesis Techsoft_
Atlassian Partner
September 19, 2023

Hello,

 

Can you please help me with the Jira expressions condition to Evaluate whether the previous status was "Open"

 

(issue.changelogs.filter(c => c.items.filter(i => {i.field.includes("status") } ).length > 0).length > 0)

 

So far I am able to check whether the status was changed at any time in issue history.

Now I wish to check the latest changelog alone and find if the fromString is "Open"

 

Sample payload FYR:

"items": [
        {
          "field": "status",
          "fieldtype": "jira",
          "fieldId": "status",
          "from": "1",
          "fromString": "Open",
          "to": "3",
          "toString": "In Progress"
        }
      ]

 

Thanks,

Majo

1 answer

0 votes
Tessa Tuteleers
Community Champion
September 19, 2023

Hi @Majo Francis _MicroGenesis Techsoft_ , 

question, why not use the "Previous status" condition in this case?

- Tessa

Majo Francis _MicroGenesis Techsoft_
Atlassian Partner
September 19, 2023

hello,

 

I was able to crack this:

 

issue.changelogs[0].items.filter(i => {i.field.includes("status") }).length > 0 ? issue.changelogs[0].items.filter(i => {i.field.includes("status") })[0].fromString.includes("Open") : false

 

I am trying this is a Script Listener module from Script Runner. There I am trying to add a condition via expressions..

 

Thanks,

Majo

Suggest an answer

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

Atlassian Community Events