Hi Support,
What is the different between script runner's event:
Issue Updated/CustomFieldUpdatedEvent ?
Because I write a custom listener script to judge the customfield's value,when the condition is true then auto clone the issue to other projects.
I set the event: Issue Updated/CustomFieldUpdatedEvent.
I find a bug that when the custom field condition is true, it auto clone the issue(it is correct),but users upload the attachment three times,it also auto clone issue to other projects(it is wrong).
Is it jira's bug?We use JIRA 7.2.6 version.
Should I just need to remove Issue Updated to avoid this problem.
Thanks for your great support in advance.
Issue Updated: Triggered if some field of the issue is changed.
CustomFieldUpdatedEvent: Triggered if the name or description of the field is changed.
It depends on your requirements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please note that these are not "script runner events". The events are fired by activity in Jira, and you're using Script Runner to react to them.
From "We only want to auto clone issue when the custom field condition", I think you need to forget CustomFieldUpdatedEvent.
It sounds like your requirement is "Clone issue if a custom field changes to <a value>". You will need the IssueUpdated event for that, and to then check the value of the custom field as the condition.
If my guesses there are wrong, could you clarify the requirement a bit more?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The questions is that I have already set the custom field to meet some condition and then to auto clone the issues,but when users update the attachment it also meet the condition then auto clone the issue,but this issues should not auto clone.
What should I need to avoid this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds like the condition is incorrect. Are you checking just for a change of that custom field? Could you show us the config?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The condition is correct,but if you just use IssueUpdated event then the condition is always true then someone update the issue ex:upload an attachment it also auto clone issue,but it is wrong.
Do you have any suggestions about it ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Cloud!
So are you wanting the issue to only be cloned when a certain field is updated in an issue? If so, but the clone is being made when some other field is being updated, then I'd agree with Nic in that your condition is probably wrong. If, however, the attachment field is actually the field that is supposed to trigger the event, then I imagine your issue is that you need to check for if a clone of the issue already exists; and not to make another one if it does.
Could we please take a peek at your listener config and condition to get a better idea of what might be happening in your code?
Thanks!
Aidan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1.So are you wanting the issue to only be cloned when a certain field is updated in an issue?
YES
2. If so, but the clone is being made when some other field is being updated, then I'd agree with Nic in that your condition is probably wrong.
No,Because I put IssueUpdated event and the field have already changed to my trigger condition and then happen issue updated then it is auto clone?Is it correct action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could we please take a peek at your listener config and condition to get a better idea of what might be happening in your code?
Could you please give me the mail address ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cloud,
Please post it below and we will follow up with you.
Katy
Adaptavist Product Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Support,
Because issue updated event include all event like update issue and upload file.
We need to judge only when customfield update then auto clone the issue ,thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is correct. An issue updated event tells us the issue has changed, and how.
Your condition needs to look specifically at one field within that. SR can do that easily, but it sounds like you have not configured it correctly.
Please, tell us what you have configured for this. We can't really help you until you tell us that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Cloud!
If you need to judge which custom field is the one that has been updated, you can use something like the ChangeHistoryManager to see exactly which field was the updated field.
For example:
def chm = ComponentAccessor.changeHistoryManager
def changeHistory = chm.getAllChangeItems(event.issue)
// check that the field changed was the specified custom field
if(changeHistory.field.last() == "Custom Field Name")
{
//Execute the rest of your listener code
}
That should allow you to control which field the listener fires on. But if you have an issue with a condition somewhere else in your listener, this won't be a solution. But try to implement that and test it out. Then let us know how it goes! :D
Best of Luck!
Aidan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Support,
Good Job,That is what I need.
So I only need to put Issue updated event and remove customfield updated event to test these code?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, as discussed before, the "custom field updated" event is for changes to the configuration of the custom field itself, not the values held in it for issues.
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.