Skip to main content

I am following this api doc, creating tech service document, using python/requests. After a few tries, isolated the problem to incident_urgency_rule




  1. first try, using all default values in sample code, all good


     "incident_urgency_rule": {
    "type": "use_support_hours",
    "during_support_hours": {
    "type": "constant",
    "urgency": "high"
    },
    "outside_support_hours": {
    "type": "constant",
    "urgency": "low"
    }
    },



  2. second try, simply change outside_support_hours / urgency value to high, it gives me 400 error.


     "incident_urgency_rule": {
    "type": "use_support_hours",
    "during_support_hours": {
    "type": "constant",
    "urgency": "high"
    },
    "outside_support_hours": {
    "type": "constant",
    "urgency": "high"
    }
    },



then tried a few more combinations:

3. remove the whole incident_urgency_rule block from request body, 400 error.

4. simply adding outside_support_hours / urgency value to high, 400 error.


    "incident_urgency_rule": {
"type": "constant",
"urgency": "high"
},

There are a few problems from small to big:



  1. in the doc linked above, it never said incident_urgency_rule is mandatory. and the parent response_play is even deprecated.

  2. also for outside_support_hour, the urgency default value should be high according to doc.

  3. error logs are not helpful, it simply gives me a 400 error without any useful info, nor I could find any error logs on the server side ( maybe you have this feature, and I am on a manager role which might lacking the access, please let me know) . It is very hard to understand what causing the problem.


What I want to archive is to using rest api to create a tech service which is high-urgency and escalate as needed.


image


Thank you

Hello @li a liu, I consulted our technical support team and here are some bullet points that I hope you’ll find useful:



  1. re: “incident_urgency_rule” being mandatory and “response_play” being deprecated (needs to be tested)

  2. urgency default is high. This could be a bug (support team can take care of this)

  3. we’re working on improving our APIs, but in the meantime we recommend anyone having issues file a support ticket. There are detailed logs for most things and support can help with that


In short, best course of action is file a support ticket - ideally with the account you’re using and timestamps for some actions and the specialists can help you from there and fix anything that’s gone wrong.


As a side note, since you’re accessing the API from python and using the requests package, you’d probably benefit from using PDPYRAS (user guide here), which is a python module designed for PagerDuty API interface and it also uses requests. This should remove a lot of configuration & optimization issues.


Was this helpful?






  • YES 👍

  • NO 👎





0
voters





Reply