Forums

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

Export Issues

nnng.sg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2019

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

  1. Jira settings > System

  2. In the IMPORT AND EXPORT section, click Backup manager.

  3. Under Backup for cloud, select Create backup for cloud.

What should I do?

1 answer

0 votes
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 27, 2016

Try at first to get class of returned value for custom field like this:

log.error(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('Assigned-team').getValue().getClass().getName() )

kitensei
June 27, 2016

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)
kitensei
June 27, 2016

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

Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 27, 2016

Add this to import header:

import com.atlassian.jira.component.ComponentAccessor

I also recommend you to use any IDE to write code to avoid such mistakes. I use Intellij IDEA

kitensei
June 27, 2016

The import is present, I have no errors about imports.

I think my problem is a problem of "order of things done":

  1. Issue is qualified (transition)
  2. Event "Issue qualified" is raised
  3. (On event: Issue qualified) Field "Assigned-team" is filled (scripted field)
  4. (On event: Issue qualified) Send an email to "Assigned-team"

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.

 

 

Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 27, 2016

I would recommend to set custom field value not into event listener, but into a postfunction. This is more robust approach. 

 

kitensei
June 28, 2016

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 ?

Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 28, 2016

Are you sure than event is handeled by the listener?

Add any log messages to make it clear.

Suggest an answer

Log in or Sign up to answer