why does API responds with "exceeded node count limit of 100" even though, the node count is < 100?

AutomationUIUser June 20, 2023

I'm executing below mentioned API request:

https://opshub.jiraalign.com/rest/align/api/2/Programs?$filter=portfolioId+eq+4+or+portfolioId+eq+8+or+portfolioId+eq+9+or+portfolioId+eq+10+or+portfolioId+eq+11+or+portfolioId+eq+12+or+portfolioId+eq+13+or+portfolioId+eq+14+or+portfolioId+eq+15+or+portfolioId+eq+16+or+portfolioId+eq+17+or+portfolioId+eq+18+or+portfolioId+eq+19+or+portfolioId+eq+20+or+portfolioId+eq+24+or+portfolioId+eq+26+or+portfolioId+eq+27+or+portfolioId+eq+29+or+portfolioId+eq+30+or+portfolioId+eq+31+or+portfolioId+eq+32

The response of this contains 48 nodes, still it gives error as:

"Cannot get programs. The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on EnableQueryAttribute or ODataValidationSettings."

What could be the possible cause of this behavior?

1 answer

0 votes
Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2023

 The simple answer is that your Filter clause is too long.  I get the same error that you are getting, but if I delete the everything after the last "OR" clause, it works as expect.

AutomationUIUser June 30, 2023

With the last "OR" clause, the node count is only 48. Ideally, it should work regardless of length of filter clause

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 30, 2023

@AutomationUIUser How are you defining "node count"?  How do you determine node count is 48?  I believe "Node Count" refers to the number of tokens in the SELECT clause.

AutomationUIUser July 3, 2023

Definition of node count is fine, but how do I decide from query parameters that this query will not result in error?
i.e. query given in the question itself, how do I decide that how many OR clause should I add? query up to "portfolio+eq+31" it will give proper result, but with last OR clause it will give error, so how do you define query parameter limit?

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2023

I think "portfolioID eq 5 and" is four tokens, so you can only select 25 portfolios at a time.  

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2023

you're query string parameters are still too abundant.  The query about will work if you delete the last "OR" clause.

JJ Banda
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!
August 3, 2023

I have the same issue: query ran with 79 tokens works just fine, add another 4 tokens and the API gives a 400 error.

There is clearly a limit to the number of filter conditionals (tokens) that can be used at once - what is that limit? It's not 100.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events