Ad Widget

Collapse

API - add dependency

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • quackduck
    Member
    • Feb 2025
    • 36

    #1

    API - add dependency

    Want to make one trigger dependent on the other - I have the trigger-IDs.

    The only documented API-call to set this dependency is through trigger.update:


    Pardon my French, but it's not documented anywhere how to NOT delete all the old dependencies: it's not documented how to get the old ones so you can include them in the update.

    Has anyone bought the paid/support documentation and want to share how to get the dependencies here?

    There was some "adddependency" (yes, 3 Ds) api call in the older versions, but it was removed and the paid support/documentation is now required to figure this out unless you read the source code.
    Last edited by quackduck; 18-03-2025, 13:54.
  • Answer selected by quackduck at 18-03-2025, 14:50.
    Brambo
    Senior Member
    • Jul 2023
    • 245

    It's just in the manual, only you have to start with get. https://www.zabbix.com/documentation...ce/trigger/get
    And from the data you filter out on your get request you can retrieve the details from a template. So if you do a request selectDependencies on true.
    Then you get an array of ID's with of triggers which have dependencies. And it's up to your code how you process this data. For example you update call can include all existing dependencies ID or replace something.

    Comment

    • Brambo
      Senior Member
      • Jul 2023
      • 245

      #2
      It's just in the manual, only you have to start with get. https://www.zabbix.com/documentation...ce/trigger/get
      And from the data you filter out on your get request you can retrieve the details from a template. So if you do a request selectDependencies on true.
      Then you get an array of ID's with of triggers which have dependencies. And it's up to your code how you process this data. For example you update call can include all existing dependencies ID or replace something.

      Comment

      Working...