I found out about this weird behavior and I'm checking if this is right.
I have the following code on the initializer of the behavior
def issueType = getFieldById("issuetype")
issueType.setDescription("${issueType.formValue.class}")
If I'm on the edit screen I got a String, if I'm on the create screen I got a Long.
is this the expected behavior?
When you're on Create, the issuetype "getter" won't work, it's not a regular field, per se, don't know the exact magic or logic, but..
getIssueContext().getIssueType() // to get IssueType object
getIssueContext().getIssueTypeId() // get the ID (as String, mind you)
getIssueContext().getIssueType().getName() // the pretty name
You can use these in either create or edit, and they should return reliable and consistent values. Not sure what FormField#getFormValue() returns outside of IssueContext, but the above is the way to get reliable stuff out of it.
Hello @Pedro Felgueiras
As Radek has mentioned, it is better to use the issueContext as per the Adaptavast behavior documentation, something to consider. On the create screen the issue does not exist in the database yet.
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.