Hi
I have an issue with a script that i have designed for Jira.
import com.atlassian.jira.component.ComponentAccessor import org.apache.log4j.Category def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction") log.setLevel(org.apache.log4j.Level.DEBUG) def attachmentManager = ComponentAccessor.getAttachmentManager() log.debug "--------- DELETE ATTACHMENTS ---------" attachmentManager.getAttachments(event.issue).each { if (it.getFilesize() <= 9000 && (it.getFilename().endsWith(".png") || it.getFilename().endsWith(".jpg") || it.getFilename().endsWith(".gif"))) { attachmentManager.deleteAttachment(it) } }
This script is the listener its suppose to remove attachments of certain types and size. The issue is that it does not do this when an issue is created via email. It works perfectly when i create an issue in JIRA but not when creating an issue via an email. It executes but it does nothing.
Regards
I have already tried to schedule a listner for issue created the result was the same what do you mean by a scheduled service?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest you proceed by trying a listener on Issue Created, or a scheduled service that does this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I tried now to both move the script to the end of the transition after the generic event is fired no change. It still runs but no action is taken on the attachments
Please see the payload
{ "full.module.key": "com.onresolve.jira.groovy.groovyrunnerrungroovy-function (java.lang.String)", "canned-script": "com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CustomScriptFunction (java.lang.String)", "class.name": "com.onresolve.jira.groovy.GroovyFunctionPlugin (java.lang.String)", "issue": "MERCURDESK-435 (com.atlassian.jira.issue.IssueImpl)", "passesCondition": "true (java.lang.Boolean)", "transientVars": { "entry": "com.opensymphony.workflow.spi.SimpleWorkflowEntry@6819945a", "issue": "MERCURDESK-435 (com.atlassian.jira.issue.IssueImpl)", "configuration": "com.opensymphony.workflow.config.DefaultConfiguration@3b24999", "context": "com.opensymphony.workflow.basic.BasicWorkflowContext@7a26a513", "createdStep": "SimpleStep@8[owner=, actionId=0, status=Open] (com.opensymphony.workflow.spi.SimpleStep)", "actionId": "1 (java.lang.Integer)", "currentSteps": "[SimpleStep@8[owner=, actionId=0, status=Open]] (java.util.ArrayList)", "pkey": "MERCURDESK (java.lang.String)", "store": "com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore@499c3322", "descriptor": "com.atlassian.jira.workflow.ImmutableWorkflowDescriptor@4ac9db8b" }, "log": "org.apache.log4j.Logger@71976318" }
How would you suggest i proceed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is that the attachments are not available to the post-function at the time it runs, when creating an issue via email. This is a JIRA bug, imho. What is the position of the post-function, ie, can you try making it last?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI i also tried running it as a post function in the create issue workflow. Same results it works fine when creating the issue but when creating issue via email the script is run but no action is taken
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA Software 7.0.10 and JIRA Service Desk 3.0.10 and Scriptrunner Installed version:
4.2.0.5
The issue is with a workflow in Servicedesk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Version of JIRA and the plugin?
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.