Details
-
Suggestion
-
Resolution: Won't Do
-
None
Description
NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.
Previous issue JRA-19321 was closed without resolution, but numerous questions in answers.atlasian.com point to this being a common need.
Oddly I get exactly what I want from JIRA started by the SDK (v6.2.1#6256-sha1:f72b283), just not running instances.
see
- https://answers.atlassian.com/questions/276206/issue-missing-from-relevantparams-in-customfield-validate
- https://answers.atlassian.com/questions/239068/how-to-get-current-project-and-issuetype-in-method-validatefromparams-method-in-my-customfield-plugin?page=1#276220
- https://answers.atlassian.com/questions/58011/custom-field-validation-how-to-get-an-issue-instance
SDK provides Issue in relevantParams
[INFO] [talledLocalContainer] Keys for 'relevantParams' [INFO] [talledLocalContainer] ====================KEY: null [INFO] [talledLocalContainer] ====================KEY: issue [INFO] [talledLocalContainer] ====================KEY: requireProjectIds
Standalone JIRA does not
[INFO] [talledLocalContainer] Keys for 'relevantParams' [INFO] [talledLocalContainer] ====================KEY: null
—
A custom field may be sensitive to the project context of the issue currently being validated. For instance I would like to get the list a actors associated with a project role of the project referenced by the issue being validated. The CustomFieldType interface method "public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)" does not pass the Issue reference so I can't determine the projectId. I have tried different hacks to get access to the current issue (i.e. getting the "EditIssue" action from the Action context. The problem here is that if you edit another issue in another browser tab of the same browser, the second issue will overwrite the "Edit Issue" Action before the first Issue is validated.
If system field types get an Issue reference in the validation method why don't custom field types.
Attachments
Issue Links
- is cloned from
-
JRASERVER-19321 Request reference to the Issue object in the CustomFieldType interface method validateFromParams
- Closed
- relates to
-
JRACLOUD-37627 Request reference to the Issue object in the CustomFieldType interface method validateFromParams
- Closed