I'm trying to follow the instructions here on how to export issues from Jira.
https://confluence.atlassian.com/adminjiracloud/exporting-issues-776636787.html
However, I do not see any of these in my dashboard
Jira settings > System
In the IMPORT AND EXPORT section, click Backup manager.
Under Backup for cloud, select Create backup for cloud.
What should I do?
Try at first to get class of returned value for custom field like this:
log.error(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('Assigned-team').getValue().getClass().getName() )
Returns an error:
2016-06-28 08:58:39,273 http-bio-8443-exec-56 WARN admin 538x99379x2 fkmhrg 10.0.105.52,192.168.15.13 /rest/scriptrunner/latest/user/exec/ [c.o.s.r.rest.common.UserScriptEndpoint] Script console script failed:
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl#getRelevantConfigScheme.
Cannot resolve which method to invoke for [null, class com.atlassian.jira.issue.fields.CustomFieldImpl] due to overlapping prototypes between:
[interface com.atlassian.jira.issue.context.IssueContext, interface com.atlassian.jira.issue.fields.ConfigurableField]
[interface com.atlassian.jira.project.Project, interface com.atlassian.jira.issue.fields.ConfigurableField]
at com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManager$getRelevantConfigScheme$0.call(Unknown Source)
at com.onresolve.scriptrunner.customfield.GroovyCustomField.getRelevantConfig(GroovyCustomField.groovy:322)
at com.onresolve.scriptrunner.customfield.GroovyCustomField$getRelevantConfig$0.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.customfield.GroovyCustomField$getRelevantConfig$0.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.customfield.GroovyCustomField.getValueFromIssue(GroovyCustomField.groovy:159)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:386)
at Script427.run(Script427.groovy:25)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The weird thing is that the error log is displayed in the console (catalina.out) but not on the web console, is this normal ?
It seems like there is a kind of delay preventing the scripted field to work correctly.
customfield.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add this to import header:
import com.atlassian.jira.component.ComponentAccessorI also recommend you to use any IDE to write code to avoid such mistakes. I use Intellij IDEA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The import is present, I have no errors about imports.
I think my problem is a problem of "order of things done":
The problem is that the two event listeners are triggered parallelly, therefore the scripted field value isn't set yet.
How can I handle this ? Should I generate two events, one for qualification and one for sending the email to my team ? Or should I prefer a "watcher" approach (set the user as a watcher instead of a scripted field, and send an email to all watchers) but I'm not sure the problem will be any different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would recommend to set custom field value not into event listener, but into a postfunction. This is more robust approach.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok that worked great, but now no email is sent with the Issue Qualified event.
image2016-6-28 12:25:58.png
The field is set properly with an existing user (that's what the script is doing) then an event is raised and configured in the JIRA Events, but no email is sent, never, the event is raised because adding an Event Listener it get called.
Any ideas ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure than event is handeled by the listener?
Add any log messages to make it clear.
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.