Hello,
I'm trying to create a button that will trigger an external script (by using Groovy inline script).
I want this button not to be based on a transition within the WF itself, but as a standalone button, that will be able to be processed only if various conditions will be met.
After I've investigated the issue I understood that the solution can be achieved by creating a Custom web item (via Script Fragments of ScriptRunner) that will trigger a custom Rest endpoint in which my Groovy script will be written, but when I did that I realized that some of the class which I'm wishing to use are unavailable (e.g. import com.atlassian.jira.issue.fields.Field
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.customfields.option.LazyLoadedOption)
Am I going in the right direction? or there is a different recommended best practice in order to achieve my goal?
Thanks,
Adiel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just trying to understand ... are you trying to do some issue related task when the button is clicked?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not exactly. basically when the button is clicked the inline Groovy script is calling an external Python script that runs in the background.
At the end of the Python script execution, an HTML file is being attached to the original Jira issue from which the process was initially triggered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can try setting the context issue. not sure it will help to what you are trying to do.
def issue = context.issue as Issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Krishnanand Nayak , but I'm receiving the following error: 'The variable [context] is undeclared'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Adiel Segal have you made any progress on this or have a script that will explain what you are trying to do?
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.