---
title: "Transitioning Issues Based on Custom Field Conditions"
canonical: "https://support.appfire.com/space/SUPPORT/821100699/Transitioning%20Issues%20Based%20on%20Custom%20Field%20Conditions"
format: markdown
---
**Overview:** This KB article guides how to configure a Jira workflow to transition issues automatically based on conditions evaluated from custom fields.

**Instructions:**

1. **Identify Custom Fields:** First, identify the custom fields you want to use for your conditions. In the provided example, `customfield_11778` and `customfield_13163` are single-select custom fields. Ensure these fields are correctly configured in your Jira instance.
2. **Determine Transition IDs:** Determine the transition IDs for the transitions you want to trigger based on the conditions. In the provided example, transition names` Done` and `Escalate` are used. You can find these IDs by inspecting your workflow configuration in Jira administration.
3. **Create a '**[https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465242612](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465242612) **' Post-Function:** Navigate to your workflow configuration and add a 'Transition issue(s)' post-function to the transition leading to the 'DONE' status. Choose 'Calculated Transition' and insert the following code:

```
{% if issue.customfield_11778 == null or (not issue.customfield_13163 or not issue.customfield_13163.value) %}
21 (Done@@Software Simplified Workflow for Project ABC) or (Transition ID(s))
{% else %}
41((Escalate@@Software Simplified Workflow for Project ABC)or (Transition ID(s))
{% endif %}
```

**Note : It’s always recommended to use Transition ID(s) instead of name(s) in the script.**

![image](media://9152b2c5-502d-4205-b3e0-96aa392bbac9)

 

Here's the breakdown of the script and its use-case:

- **Use-case:** The script aims to determine the transition to be executed on an issue within the "Software Simplified Workflow" for a project named "Project ABC."
- **Conditions:**
  - If `customfield_11778` is empty (`null`) or if `customfield_13163` is empty or does not have a value (`not issue.customfield_13163 or not issue.customfield_13163.value`), then the "Done" transition is selected for execution.
  - If the above conditions are not met (i.e., `customfield_11778` is not empty and `customfield_13163` has a value), then the "Escalate" transition is chosen for execution.
- **Transition Execution:**
  - If the conditions for the "Done" transition are met, the script returns `Done@@Software Simplified Workflow for Project ABC`  21(Transition ID(s)).
  - If the conditions for the "Escalate" transition are met, the script returns `Escalate@@Software Simplified Workflow for Project ABC` 41(Transition ID(s)).

Replace `customfield_11778` and `customfield_13163` with the correct IDs of your custom fields. Also, replace the Name of the workflow with the name of your workflow.