Find what automation rules contain certain values (i.e. custom fields) using Python

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Disclaimer

Atlassian does not support this code below, which is provided "AS IS". The goal of this article is to provide a piece of code that illustrates one way to achieve the desired goal.

Feedback provided at the bottom of the page is appreciated, but won't be handled as support.

The Python script on this page searches across a JSON from the automation rule export. If the inserted value is present in your JSON file, it will return the position within the JSON and the automation rule name and state (enabled/disabled).

Solution

Environment

Jira Cloud

This script requires Python 3 to be installed.

Usage

  1. Export all your automation rules to JSON following this article.

  2. Ensure the script and the JSON file are in the same folder structure.

  3. Run the script. You’ll be prompted with the value to search for and the JSON file name (remember the .json file extension).

  4. The results will be shown in the console.

Script

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import json def find_value(json_obj, value, path="", parent_name=None, parent_state=None): if isinstance(json_obj, dict): if "name" in json_obj and "state" in json_obj: parent_name = json_obj["name"] parent_state = json_obj["state"] for key, val in json_obj.items(): new_path = f"{path}.{key}" if path else key if isinstance(val, list) or isinstance(val, dict): find_value(val, value, new_path, parent_name, parent_state) elif isinstance(val, str) and value in val: print(f"Found '{value}' at {new_path}") print(f"Name: {parent_name}") print(f"State: {parent_state}") elif isinstance(json_obj, list): for i, item in enumerate(json_obj): new_path = f"{path}[{i}]" find_value(item, value, new_path, parent_name, parent_state) # Manually input the value to search for search_value = input("Enter the value to search for: ") # Manually input the JSON file name json_file_name = input("Enter the JSON file name: ") print(f"Searching for '{search_value}' in the JSON {json_file_name}") # Load JSON data from a file with open(json_file_name) as json_file: data = json.load(json_file) find_value(data, search_value)

Practical example:

(Auto-migrated image: description temporarily unavailable)

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.