Forums

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

stateCount not up to date on pull request merge

Bruno Sabot
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 2, 2025

Hello there!

I have an automation, when a pull request is merged, that:
 - Check if the issue still have other opened PR
 - If it doesn't, it closes the issue.

However, even when the closed PR is the latest one, it doesn't work.
After a bit of debug, it seems that in 99% of the cases (it miraculously works 1% of the time), the JQL development[pullrequests].open = 0 doesn't work because the work item itself still consider that the pull request is opened. Here is an example of the PR state.


{
pullrequest={dataType=pullrequest, state=OPEN, stateCount=1},
json={
"cachedValue":{
"errors":[],
"summary":{
"pullrequest":{
"overall":{
"count":1,
"lastUpdated":"2025-04-30T15:37:42.000+0200",
"stateCount":1,
"state":"OPEN",
"dataType":"pullrequest",
"open":true
},
"byInstanceType":{
"GitHub":{
"count":1,
"name":"GitHub"
}
}
}
}
},
"isStale":true
}
}

I tried to "Re-fetch work item data" before my JQL query, but it doesn't work either.

It's an automation that used to work but it start dysfunctioning around the 26th of march, according to my logs.

0 answers

Suggest an answer

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

Atlassian Community Events