Skip to main content

A post function doesn't seem to run

How to find out whether a Script Master post function ran, and why it didn't do what you expected.

Symptom​

After a transition, the change your post function should make, such as a comment or a field value, isn't there. The work item shows no error.

Find the cause​

  1. Open the workflow and edit the post function on that transition.
  2. Look at Recent runs under the editor, and select the latest run to see its console output and error.

Recent runs needs a Jira admin. Space admins of team-managed spaces can't open it. To see the error, test the script on the work item in the editor's test panel.

The post function isn't on that transition​

Cause: The post function is on another transition or another workflow, or the workflow with it isn't the one the space uses.

Solution: Check the workflow on the Workflows tab in Script Master, which lists each workflow's scripted rules. See The Workflows tab.

The script failed​

Cause: The script threw an error or couldn't reach the Companion App. The transition still happened: post functions run after the move.

Solution: Read the error in the run. If it says Local script execution is not supported., see Server-side modules show "Action Required". Otherwise fix the script and test it. See Workflow post functions.

The script ran but changed nothing​

Cause: A request to Jira can fail without the script failing: requestJira returns the error response instead of throwing, so the run still counts as a success.

Solution: Log the response status and body of each request with console.log, run the transition again, and read the output in Recent runs.