Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Set Custom Fields (Incoming Mail Handler)

Batuhan ŞEN August 10, 2022

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
Batuhan ŞEN August 12, 2022

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira product discovery learning path, product discovery training, idea prioritization, align stakeholders, discovery to delivery, product collaboration, atlassian learning, dev process, roadmap planning, insight capture, team alignment

Elevate Your Skills with Jira Product Discovery!

Unlock your potential and learn how to use Jira Product Discovery to your advantage. You’ll have the expertise to revolutionize ideas and insights, roadmapping, engage and align teams and stakeholders, and deliver the best solutions—faster. Enroll today!

Start Learning
AUG Leaders

Atlassian Community Events