I'm trying to write a validation script using the behaviors plugin that pulls the state of all sub-tasks on a given issue and sets the validity of a field according to the states.
I assumed I could use 'issue.subTasks' but it doesn't look like the 'issue' variable is bound to the issue being edited/transitioned.
Any suggestions?
Figured this out. The issue id is available as a field with field id of "id", so ...
Long issueId = new Long(getFieldById("id").getValue());
Issue issue = ComponentAccessor.getIssueManager().getIssueObject(issueId));
"underlyingIssue" is bound in the scripts which is an Issue instance... your way will work fine but make sure you handle the Create case, where issue will be null.
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.