Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,972
Community Members
 
Community Events
168
Community Groups

How to Set Custom Fields (Incoming Mail Handler)

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.

 

 

1 answer

1 accepted

0 votes
Answer accepted

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,048 views 18 32
Read article

Atlassian Community Events