Hi,
I am using ScriptRunner on my Jira cloud instance. I am trying to add a custom script as a post function for a transition in my Workflow in Jira. When I try to create the script at first, it shows me 4 automatically available parameters, like this:
But, the next time when I try to update the script, it is showing only these two automatically available parameters:
What might be the reasons behind this?
Note: I have added this workflow to a workflow scheme and also associated this workflow to a company-managed software type project. After activating this workflow, I am trying to add this script as a post function.
Once a post function is in place, it knows what the logger and issue are, so it doesn't remind you again.
But, as you can see, the variable definition for issueKey is showing an error stating that static type checking, [issue] was not defined.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like the second screenshot is not of a post-function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I think I failed to show my real scenario. The second screenshot is indeed of a post function. I am just trying to modify the post function.
At first I have written the script in the post function by creating a new script in ScriptRunner. The next time I am trying to modify the same script, that's when I find the error in the script (as in the second screenshot) and the two aforementioned variables (issue and transitionInput) absent from the list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- , it would be great help to me if I knew the reasons behind the situation I am facing. Would you please give some suggestions how to resolve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What warning are you getting if you hover the cursor over the waning triangle? I ask because the issue object should be automatically available to post-function scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your response. I am getting error: [Static type checking] - The variable [issue] is undeclared.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- , though this part is still showing error in the script, the post function is executing correctly. So I think this is not a big issue. The issueId is pulled from the associated Jira issue though the error is visible in the script. Thank you for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.