Helper functions

 

To simplify working with persistent variables, you can use two helper functions. These functions let you manage variables outside of an issue's context. You can use them to either set and retrieve values for issue-specific variables, or access global variables.

Functions

  • Page:
    setPersistentVar (Power Suite Apps for Jira) — Sets the persistent var, as a string
  • Page:
    getPersistentVar (Power Suite Apps for Jira) — Gets the persistent var, as a string

Examples

These examples show the difference between global and issue-specific variables:

// Example 1: Retrieving a global counter string globalCounterVar = getPersistentVar("counter"); // This gets a counter that's available across all issues // Example 2: Retrieving an issue-specific counter number test_one_counter = getPersistentVar("TEST-1", "counter"); // This gets a counter specific to issue TEST-1

Although you can work with different data types like numbers, all persistent variables are stored internally as strings. The system automatically handles the conversion (casting) between types as needed.

While persistent variables are powerful tools, they can impact system performance if used extensively. Currently, there is no built-in method to remove persistent variables (except through direct SQL operations). We recommend carefully evaluating your use case before implementing persistent variables in your solution.

See More