When I try to use "issue.summary = 'NEW TASK: ' + sourceIssue.summary" I get the following error message. Any advice that how can I get parent issue id?
subtasksUpdated=false], SingleParameterMethodListenerInvoker{method=public void com.onresolve.scriptrunner.runner.ScriptListener.workflowEvent(com.atlassian.jira.event.issue.IssueEvent), listener=com.onresolve.scriptrunner.runner.ScriptListener@3af167d7}]' from the invoker 'java.lang.RuntimeException: No such property: sourceIssue for class: Script3'
Thanks in advance.
/Bala-
Unfortunately that's not going to work when used as a listener, and I can't think of any other way of getting access to it.
I fixed it in https://jamieechlin.atlassian.net/browse/GRV-590 - LMK if you want a snapshot version to test it.
Hi Jamie Echlin, we are using Jira 6.3.5a#6334, and script runner version 3.0.7, Java 8. Hope this helps a little. And I would like to test the snapshot and please let me know how to get that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay, I will get to this next weekend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie Echlin, kindly let me know if is there any update on this regards. Thanks and Regards Bala.
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.
Sorry, i know you're waiting. Target is to get the release out within 10 days.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot of response. Just asking if is there anything happening on this regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
3.0.9 has been released now which has this.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for very quick response Jamie. I would like to test the snapshot version.
It would be of great help for another clarification. Below is the code which I am trying to make it work with Post Function of create transition in workflow. In this I am trying to copy the watchers of an linked issue, but I am not getting the linked issue at all, but when I check the issue after creating it is having the link. I suspect that the post function is triggered before the issue link is created or some other thing which is going on which I could not understand. If you have any input for me kindly let me know. I tested the same script with Script Console with some test issue, that is working.
import com.atlassian.jira.ComponentManager
import org.apache.log4j.Category
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.setLevel(org.apache.log4j.Level.DEBUG)
def componentManager = ComponentManager.getInstance()
def issueLinkManager = componentManager.getIssueLinkManager()
def watcherManager = componentManager.getWatcherManager()
def userManager = componentManager.getUserUtil()
//Set the issue id in below so, the script can be tested
//def issue = componentManager.getIssueManager().getIssueObject("TOOL-127")
log.debug "ADDWATCHERS: The script for inheriting all watchers from Bug to Fix while creating Fix for Bug"def watchUsers = {userNames ->
log.debug "inside watch user"
userNames.each {
def user = userManager.getUser(it)
watcherManager.startWatching(user, issue.getGenericValue())
}
}
if(issue != null && issue.getIssueType().name == "Fix") {
log.debug "ADDWATCHERS: FIX ID: " + issue.toString()
issueLinkManager.getInwardLinks(issue.id).each {
issueLink ->
if (issueLink.issueLinkType.getInward() == "is fix of") {
def linkedIssue = issueLink.sourceObject
log.debug "ADDWATCHERS: BUG ID " + linkedIssue.toString()
def bugWatchers = watcherManager.getCurrentWatcherUsernames(linkedIssue)
log.debug "ADDWATCHERS: bug watchers list " +bugWatchers
def fixWatchers = watcherManager.getCurrentWatcherUsernames(issue)
log.debug "ADDWATCHERS: fix watchers list before copying from BUG" +fixWatchers
watchUsers (bugWatchers)
def fixWatchersAfter = watcherManager.getCurrentWatcherUsernames(issue)
log.debug "ADDWATCHERS: fix watchers list after copying from BUG" +fixWatchersAfter
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.