Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

qtag_exists

Checks for the existence of a specific key in a QTAG-formatted comment from a specific source (publisher). Returns TRUE if the key is present in a valid QTAG comment for that source, FALSE otherwise.

Context

This function is available for use in Sundeck pre- and post-hook conditions.

Syntax


QTAG_EXISTS(<source>, <key>) RETURNS BOOLEAN

Arguments

<source>
The identifer of the publisher of the QTag comment (per the list below of pre-defined QTag sources); if the <source> string does not match one of these pre-defined strings, then the value passed is used to string-match the first portion of the QTag comment (between the initial -- and the first { which denotes the beginning of the JSON object.
<key>
The object key we want to search for within the QTag comment object

Usage Notes

This function is available for use in Sundeck pre- and post-hook conditions.

Examples

QTag CommentFunction CallReturns
-- { "app":"sundeck", "job": "my_job" }QTAG_EXISTS('sundeck', 'job')TRUE
-- { "app":"sundeck", "job": "my_job" }QTAG_EXISTS('sundeck', 'other_key')FALSE
-- { "app":"sundeck", "job": "my_job" }QTAG_EXISTS('other_source', 'job')FALSE

Pre-defined QTag Sources

The following are the pre-defined QTag source identifiers which are recognized by the qtag_exists() function:

  • dbt
  • hex
  • mode
  • sigma
  • sundeck

JSON comments written by these tools have a vendor-specific format, and QTag recognizes and decodes these. Note that additional vendor-specific formats are being added continuously by the community, so check back often!