I need to update the Request status to "closed" using iTop API, and I created a
Trigger (on entering a state) with state: closed, but unfortunately the trigger doesn't work.
I note that the trigger work only when the user take the action from iTop.
How can I solve this problem, please?
I use c#
varclient=newRestClient("http://"+iTopOptions.Host);client.Authenticator=newHttpBasicAuthenticator(iTopOptions.User,iTopOptions.Password);varrequest=newRestRequest($"webservices/rest.php?version=1.0&json_data="+$"{JsonConvert.SerializeObject(UpdateObj)}",Method.POST);request.RequestFormat=DataFormat.None;varresp=client.Execute(request);Console.WriteLine("request has been updated");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh, I found noticed something. Through the REST API, do you set the status value or do you use the "apply_stimulus" operation?
If you set the status value, it's normal that the trigger isn't activated because it doesn't consider that it has entered a state.
You should rather make a second REST call with the "apply_stimulus" operation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello dears,
I need to update the Request status to "closed" using iTop API, and I created a
Trigger (on entering a state) with state: closed, but unfortunately the trigger doesn't work.
I note that the trigger work only when the user take the action from iTop.
How can I solve this problem, please?
I use c#
Hello Marah,
Can you share a screenshot of the trigger? Have you set a "context" on it?
Guillaume
Hello Guillaume,
iTop version 2.6.1 doesn't have this attribute.
But I noticed that version 3.0 has this attribute, so I will upgrade to version 3.0.
thanks a lot.
You don't need to upgrade to 3.0, I was only asking to see if you had put something in it which would have explain the issue.
Could you share a screenshot of the trigger anyway?
Dear Guillaume,
kindly find the attached photos.
Even when I set "context" to "REST" and "console", the trigger doesn't work :(
Oh, I found noticed something. Through the REST API, do you set the status value or do you use the "apply_stimulus" operation?
If you set the status value, it's normal that the trigger isn't activated because it doesn't consider that it has entered a state.
You should rather make a second REST call with the "apply_stimulus" operation.
Thank you Guillaume,
we make another REST call with the "apply_stimulus" operation and the trigger work.
I appreciate your consistent help .
Glad to see you fixed it :)