Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with script of Transition Linked issues with scriptrunner

Laura Carbonell
July 15, 2021

Hi!. 

I'm trying to create a script with scriptrunner to be able to tansition two linked issues that, each from different projects. What I want is that when one of these issues goes to "done", the other one does it automatically. 

¿Does anyone have an example of a script i can use?

¿Do i have to select a postfunction or a condition in scriptrunner?

I'm new in groovy and I'm lost!

Thanks!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alejandro Suárez García
Atlassian Partner
March 3, 2019

Hi @Akbar N ,

You can use a Simple Script Validator:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()

CustomField dosOpciones = customFieldManager.getCustomFieldObject(11111L)
def optionList = issue.getCustomFieldValue(dosOpciones).size()

optionList <= 2
Swarna Radha
Contributor
July 7, 2020

Hi @Alejandro Suárez García ,

 

I am getting error in this line 

def optionList = issue.getCustomFieldValue(dosOpciones).size()

 

Please advice.

 

Thanks,

Swarna 

Alejandro Suárez García
Atlassian Partner
July 14, 2020

Hi @Swarna Radha you have to change the ID of the field to match your CustomField ID

TAGS
AUG Leaders

Atlassian Community Events