Hello,
I want to trigger one of my Script Listener programatically in the Script Console.
I think I have to "publish an event".
my research brings me to the class EventPublisher, but I don't understand how to use it...
With this class I should be able to publish an "Issue Updated" event on some Issue.
Has anyone ever tried ?
What you mean by "publish an event" if you want the script to run on issue update event then run the script on issue update event.
Excuse me I forgot to say that I want to trigger a Listener (activated with event "Issue Updated") programatically in the Script Console.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it's possible, try to get a specific issue and run the script on it from the Console:
Add this to your code-
def issue = ComponentAccessor.getIssueManager().getIssueObject("TS-93221")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already use this technique to test my Listener, but what I would like is more complex...
I try to copy som field from an Issue to an other Issue, both of them in differents Projects and differents issueTypes.
I have a field in the target Issue like "Name of source Issue", the name who's inside is like an id in a BDD.
Example :
Source Issue with Summary = "A"
some Target Issue with Summary = "B" and field "Name of source Issue" = "A"
This Issues are linked.
My Listener copy some field from Source to Target when the Source is updated.
For example :
I have a field "Category" in both Issues, and when I update the field in the Source Issue like "Category" = "123", my Listener is fired and it's update the field in the Target Issue !
Well, this works fine, but... I want to add a new Issue in the chain !
new Target Issue with Summary = "C" and field "Name of source Issue" = "B" (remember, "B" it's our first Target)
So basically, my field "Category" it's copied in cascade :
Issue "A" -> Issue "B" -> Issue "C"
The problem is, my Listener can't copy from "B" to "C" when is fired on the "A" update...
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.