Having some trouble with Script Fragments in Jira Software 8.1.0. and Adaptavist ScriptRunner 22.214.171.124-jira8.
One of my projects contains a unique Issue Type called AWS Migrations. We create a parent issue and six sub-tasks underneath it for each software environment (QA, Pre-Prod, Practice, Production, and Demo).
I want to replace the Clone button with multiple scripts to Clone to P_PRE, Clone to P_PS, Clone to P_PRD, and Clone to P_DEM. This will allow me to create a custom clone script that also edits certain values in the master ticket that are important for each environment.
My first script fragment should hide the Clone option from the More dropdown, but only if the Issue Type is AWS Migrations. I added the following condition and it works fine.
! (issue.issueType.name == "AWS Migration")
My next script fragment is to add a new option Clone to P_PRE to the More dropdown. Since this should only be available if Issue Type is AWS Migrations, I figured this should work.
issue.issueType.name == "AWS Migration"
Instead, I get the following checking error:
[Static type checking] - The variable [issue] is undeclared.
@ line 1, column 1.
Why is this happening? What is the correct syntax for the condition?
I think you are mistaking web section and web item
web section is basically what it is - a section (like how you see "create sub-task" button in your example is separated from top and bottom elements - that's because it'l located into it's personal section)
So I'd refer to examples here:
I guess different types of fragments have different types of Binding Variables.
What kind of fragment are you using in the second case? Also, there's a (?) question mark button in the bottom right corner which shows which variables you can use without declaring to help you.
Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their Jira Cloud instance. ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events