Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner Dynamic Forms > how to use in method?

Petr Papousek
Contributor
October 19, 2020

Hi @Adaptavist Supp,

On ScriptRunner 6.5.0-p5 & JIRA 8.5.8, I'm trying to utilize Dynamic forms feature

when used in simple script (which is then in fact compiled into class anyway), it works as expected.

However if I try to use in a class like this (file ParClass.groovy):

package experiment

import
com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.scriptrunner.parameters.annotation.ShortTextInput

class ParClass extends FieldBehaviours {
def run() {
@ShortTextInput(label = "Summary", description = "Enter a short issue summary")
String asdf

return asdf
}
}

I get the following error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/.../scripts/experiment/ParamClass.groovy: 8: Script parameter annotations are only allowed at the top level of scripts and inside of instance methods @ line 8, column 9. @ShortTextInput(label = "Summary", description = "Enter a short issue summary") ^ 1 error

Am I doing something wrong, or is this approach not supported (yet)? Error says "and inside of instance methods", but I wasn't able to get it running in a method

Best regards,
Petr

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Tomáš Vrabec
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 21, 2022
0 votes
Tomislav Sablic
Contributor
August 24, 2020

I am also curious. Did you find the solution?

Mark Johnson
Contributor
August 24, 2020

@Tomislav Sablic - Sorry, I have not found a solution yet.

Basit Rehman
Contributor
March 10, 2021

Hi did you guys find any solution to this problem?

TAGS
AUG Leaders

Atlassian Community Events