Hi all,
I'm trying to create a behavior, in which will be a field called "PVPCommit" that in general will populate the current value that appearing in the "Fix version" field(Standard system field). if the value in the 'Fix version' will change, the behavior should notice that so that the current value under "Fix version" will concatenate to the 'old' fix version values that already apear under the "PVPCommit" field, for example in the following way: V9.16, V9.18, V9.19.
Currently, I'm a bit stuck because of two syntax errors that unfortunately I didn't manage to solve yet.
This is the code that I'm using right now:
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
def issueManager = ComponentAccessor.issueManager;
def PVPCommited
def FIX = getCustomFieldValue("fixVersions")
def FVER = FIX as java.lang.String
if (PVPCommited == null){
PVPCommited = FVER
return PVPCommited
}
else if (PVPCommited.contains(FVER)){
PVPCommited = (PVPCommited + " ," + FVER)
return PVPCommited
}
First error-related to this row: else if (PVPCommited.contains(FVER)){
Second error-related to this row: PVPCommited = (PVPCommited + " ," + FVER)
By the way, do you think that "Behavior" is the right platform for realizing my need? Is the code I wrote should appear in the "Initializer" part?
I am pretty new to the whole story of building scripts in Jira, any help will be appreciated.
Thanks
Adiel
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.