Hello everyone,
I am trying ScriptRunner Mail Handler to Create Issue With Attachments.
https://scriptrunner.adaptavist.com/5.7.2/jira/mail-handler.html
When the project has just summary, description and attachment. It works and issue is created but the project has custom fields on create screens, I am adding this code but it did not work.
How can I handle it or how can I set the custom fields using mail handler?
....
CustomFieldManager bcustomFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField bcf_ComplaintField = bcustomFieldManager.getCustomFieldObject(11111)
CustomField bcf_Comp_InfoField = bcustomFieldManager.getCustomFieldObject(11112)
CustomField bcf_ServiceField = bcustomFieldManager.getCustomFieldObject(11113)
.....
def issueObject = issueFactory.getIssue()
issueObject.setProjectObject(project)
issueObject.setSummary(subject)
issueObject.setCustomFieldValue(bcf_ComplaintField,"A")
issueObject.setCustomFieldValue(bcf_Comp_InfoField,"B")
issueObject.setCustomFieldValue(bcf_ServiceField,"C")
After added the custom fields, an error occurred like that; ( It works without custom fields)
Caused by: com.atlassian.jira.workflow.WorkflowException: Error occurred while creating issue. This could be due to a plugin being incompatible with this version of JIRA.
Thank u.
It is solved. If custom field is select list, that error is occurred. This helped me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.