You are not logged in.
Pages: 1
Hi, i'm trying to use the api tu search a ticket that's not closed.
So i'm trying that
myurl?is_deleted=0&as_map=0&criteria[0][link]=AND&criteria[0][field]=5&criteria[0][searchtype]=equals&criteria[0][value]=2&criteria[1][link]=AND&criteria[1][field]=12&criteria[1][searchtype]=notequals&criteria[1][value]=6
with the main part
criteria[1][link]=AND&criteria[1][field]=12&criteria[1][searchtype]=notequals&criteria[1][value]=6
I have as searchtype notequals but i only have in result tickets with status = 6.
like :
"data": [
{
"2": 58,
"1": "cn,",
"12": 6,
"19": "2023-08-25 10:00:32",
"15": "2023-08-23 11:08:45",
"3": 3,
"4": null,
"5": "2",
"7": null,
"18": null
},
{
"2": 62,
"1": "test",
"12": 6,
"19": "2023-08-25 09:31:11",
"15": "2023-08-23 11:13:19",
"3": 3,
"4": null,
"5": "2",
"7": null,
"18": null
},
I don't know what i'm doing wrong ?
Thanks .
Last edited by entwan (2023-08-28 17:26:08)
Offline
Which version of GLPI are you trying this with?
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
I have just created my web instance then maybe the last one ? 10.0.9 i'm not sure i don't know where to check that sorry
Offline
The status field for Tickets, Changes and Problems is actually a unique case handled with workarounds directly in the search engine. The "notequals" search type isn't supported for it. Instead, there are special values of:
1. notold: Not Solved
2. notclosed: Not closed
3. old: Solved and Closed
4. all: Any status
In your case, you should set the searchtype to "equals" and the value to "notclosed".
The other option would be to change the link from "AND" to "AND NOT" with searchtype=equals and value=6, but using "NOT" in the link type is not always the same behavior as switching between two searchtypes like equals and notequals.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Ooh ok that's working thanks you !
Offline
Pages: 1