Customfield Operations Handler // Addition of developed custom field type to JIRA Create API

Hello,

I developed a custom field type that extends AbstractMultiCFType.

I added a CustomFieldOperationsHandler for this type (in order to expose the custom field to REST). I was able to update the customfield while overriding the method:

@Override
public void finaliseOperation(Collection values, IssueInputParameters parameters, ErrorCollection errors)

and using issueManager.updateIssue

but if REST is used to create the issue, this can’t be used since no issue is yet created… so I looked up how it’s done in native classes and realzied that they are using the issueInputParameters and I fixed my code as follow:

        parameters.addCustomFieldValue(this.field.getIdAsLong(), value);

The issue is being created with no errors however the customfield is not being populated by the given value; I made sure of the syntax (it’s exactly the same syntax if we do customField.getValue(…).toString() for another issue)

No errors at all are in the logs or preventing me from creating the issue using the API; only the values of the customfield are not populated… any help?

Thanks

1 Like

Hi Christian,

If you haven’t already, I’d suggest you to check how it’s done for the class MultiSelectCFType and MultiSelectCustomFieldOperationsHandler. The later class does not inject the IssueManager and indeed it should not.

The finalizeOperation method is given the IssueInputParameters so it can fill it in. The IssueService will be called down the line, but not directly by your plugin.

1 Like

Already worked out by using in it issueInputParameters with the correct value; classes u mentioned were implemented too.

Thanks a lot :slight_smile: