Hello
I am looking for a way to test "assignee in membersOfProjectRole(PROJECTKEY)" as standard "membersOf" is restricted to JIRA groups.
I have found a pending request: https://jira.atlassian.com/browse/JRASERVER-21711
And some example code at https://mraddon.blog/2016/02/17/jql-custom-function-userinrole-with-groovy-for-jira/ and https://mraddon.blog/2017/01/03/lastcommentcontains-jql-function-for-jira-7-2-scriptrunner/
May you please provide updated code of this function for JIRA 7.6/7.7 ?
@Adaptavist SuppWould it be possible for this JQL function to be included in plugin itself ?
Thank you in advance for your help
Can you include some screenshots of your configurations?
Are you positive that the last field in the form is correctly populated: Issue Link Type / Direction
If you leave that blank, no links are created between the original and cloned issue.
If that's correct but you still don't get links, make sure the "run as" user has permission to create links.
The logs area in the execution history will only show logs that you manually output using log.info("some text") either in the condition or in the additional action blocks.
Hi Peter-Dave,
I am positive that the last field was filled out. I have also checked but there aren't even any issues being created in the target project, so there is nothing to be linked.
I am Jira Admin of our entire server at the moment (as of recently so I am not very experienced yet) and I should have all the necessary rights to move/clone/create issues. When I navigate to the relevant projects I am able to perform these actions manually so that confirms it.
Some screenshots and extra info below.
The two screenshots above show the configuration of the listener. There was a bunch of codes in the "Conditions" and "Additional issue actions" fields earlier but I scrapped all of it to be sure that these are not causing the issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've only used this configuration directly in a workflow post function.
Since you are only firing on a single project and workflow event, that might be a better place for it.
But I would try to add the following to condition (just to be sure)
log.info "Evaluating condition for Move to Pending Event: $event.issue"
true
That might give you some clues.
What I'm wondering right now is if this type of built-in script knows how to handle custom events (as yours clearly is). I've worked mostly with system events.
Or, the custom event is not loaded with an issue object and the built-in script doesn't have anything to act on.
You can troubleshoot that by creating a separate custom event and outputting to the log some of the objects bound to the custom event.
But if the built-in script can't work on the custom event, your best bet will be to move the config to the workflow postfunction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright so I've been trying a few more things.
Yesterday evening we had to reset our server because of reasons. Since the server reset, the Listener does seem to work but only if i leave the "Condition" field blank.
When I add my desired condition (which is a component check) it does not run.
log.info "Evaluating condition for Move to Pending Event: $event.issue"
issue.components == 'Jira Service Desk'
Note that I added the log.info line as you suggested, but this does not seem to provide any log info at all. As shown on the screenshot below;
However, when I trigger the Listener when the Condition field is blank (not even the log.info line is in there), the logs do return something. Note that the Listener is working in this case even though this log message shows up.
2021-03-25 18:28:00,290 WARN [servicedesk.ServiceDeskUtils]: Failed to retrieve service desk for KLVV: The Service Desk you are trying to view does not exist.
This leads me to believe that something is wrong with my (very simple) condition.
issue.components == 'Jira Service Desk'
The compared value matches the Component label set on the ticket which I used for testing perfectly. Is something else wrong with this Conditional check?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's mysterious...
Regarding component condition... try
issue.components.any{it.name == 'Jira Service Desk'}
//or
issue.components.every{it.name == 'Jira Service Desk'}
That's because issue.components should return a list of ProjectCopmonent objects. you want to compare the name of those objects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter-Dave,
I tried
issue.components.any{it.name == 'Jira Service Desk'}and now it works like a charm! Thank you very much!
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.