I am using Export (All fields) function to pull all the scripted custom fields, but logs are getting filled up with below error.
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'DocumentIssueImpl[issueKey=CDN-5922]' with class 'com.atlassian.jira.issue.DocumentIssueImpl' to class 'com.atlassian.jira.issue.MutableIssue'
at Script57.run(Script57.groovy:17)
2015-12-21 12:36:21,397 http-bio-443-exec-21508 ERROR I850693 755x2988073x14 1iysghl 10.162.5.196 /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls [onresolve.scriptrunner.customfield.GroovyCustomField] *************************************************************************************
2015-12-21 12:36:21,397 http-bio-443-exec-21508 ERROR I850693 755x2988073x14 1iysghl 10.162.5.196 /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls [onresolve.scriptrunner.customfield.GroovyCustomField] Script field failed on issue: CDN-5922, field: Deployed in Name
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'DocumentIssueImpl[issueKey=CDN-5922]' with class 'com.atlassian.jira.issue.DocumentIssueImpl' to class 'com.atlassian.jira.issue.MutableIssue'
at Script21.run(Script21.groovy:13)
2015-12-21 12:36:21,412 http-bio-443-exec-21508 ERROR I850693 755x2988073x14 1iysghl 10.162.5.196 /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls [onresolve.scriptrunner.customfield.GroovyCustomField] *************************************************************************************
2015-12-21 12:36:21,412 http-bio-443-exec-21508 ERROR I850693 755x2988073x14 1iysghl 10.162.5.196 /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls [onresolve.scriptrunner.customfield.GroovyCustomField] Script field failed on issue: CDN-5922, field: Customer Commit Date
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'DocumentIssueImpl[issueKey=CDN-5922]' with class 'com.atlassian.jira.issue.DocumentIssueImpl' to class 'com.atlassian.jira.issue.MutableIssue'
at Script39.run(Script39.groovy:17)
2015-12-21 12:36:21,662 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@33976e00[issue=com.atlassian.jira.issue.IssueImpl@55646aac[id=267772,summary=Beta FPC: Searching / follow up for new issues,key=HOA-55030,created=2015-11-19 14:59:02.507,updated=2015-12-21 12:32:10.167,assignee=C5221998:10102,reporter=C5221998:10102],remoteUser=C5221998:10102,notificationType=All_Watchers,eventTypeId=6,templateId=6] INFO ServiceRunner Mail Queue Service [renderer.wiki.links.JiraIssueLink] Unable to resolve an issue with key: HOA-55031
2015-12-21 12:36:22,426 http-bio-443-exec-21508 ERROR I850693 755x2988073x14 1iysghl 10.162.5.196 /sr/jira.issueviews:searchrequest-excel-all-fields/temp/SearchRequest.xls [onresolve.scriptrunner.customfield.GroovyCustomField] *************************************************************************************
Please let me what has to be done in this scenarios.
------------------------------------------------------------------------------------------------------------------------
Example scripted Custom Field:
-----------------------------------------------------------------------------------------------------------------------
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.util.IssueChangeHolder
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.MutableIssue
ComponentManager componentManager = ComponentManager.getInstance()
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()
String displayContent = "";
MutableIssue myIssue = issue;
def versions = myIssue.getFixVersions();
Community moderators have prevented the ability to post new answers.
I got the solution for this i was using an issue object that is a document type class as an issue directly, need to convert from the issue document to an issue in this scenario.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vasiliy!! I am able to update in issue. Here the issue is, for example if the custom field "Deployed in Name" is part of Project "A" and issue Type "Task" & "Defect"(Screens) and for Project "B" it is part of only issuetype "Task(screen)" not "Defect(screen)". in such scenarios if i try to export my query using "Export(All fields)" function it fails to cast that object in defect(screen) because custom field is used only task(screen) of project "B". how do we ignore such cases? changing Global configurations for Issuetype & project works for other custom fields but couple of custom fields are shared with lot of projects and it is really difficult to change at the configuration level. is there any way we can ignore this through Script that i am using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.