Hi,
I know how to reference fields using getCustomFieldValue("xxxx") however Im trying to retrieve the Issue Key, what reference is this under, or how would I do so in a Script Field.
Thank you.
Community moderators have prevented the ability to post new answers.
Scripted fields have the issue object directly available. So you can just say issue.getKey()
Hi Nic, following your issue.getKey I get this error: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: getKey for class: com.atlassian.jira.issue.IssueImpl A stacktrace has been logged.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need the braces on the end to tell it that it is a function rather than a property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or use: issue.key
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm betraying my pre-script-runner-I-need-to-write-a-java-plugin background there ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nick: "You need the braces on the end to tell it that it is a function rather than a property."
Can you give an example? I'm not understanding what you mean by You need the braces on the end to tell it that it is a function rather than a property. For example, what is "it" and where is the "end"?
${issue.getKey()} ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this case, issue is an object, which could have properties (fields, although not quite) and functions that run and (can) return data. getKey is a function, to which you can pass parameters in the following ().
So, no not ${getKey()}, but issue.getKey()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think, when you earlier replied to Sy, you said braces I think you meant parens... :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have a blind spot for those names! (Along with another one for it/it is/its). At least the idea was correct...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.