Forums

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

System field AffectedVersions fill by script runner

Isabel Fonseca April 7, 2025

Hello,

I have jira data center v9.12.7, and i create a script runner: when create a issue son, fill  Affected Versions from the issue dad.

When user create an issue type epic, will be create sub-tasks, and in type "Configuration" i want fill "setAffectedVersionIds", but the sub-task don't stay filled why could you helpme please ?

In logs apears filled:

CaptureLog.JPG

 

  • file scriptrunner "CreateStories.groovy

 

import com.atlassian.jira.bc.issue.IssueService import com.atlassian.jira.config.IssueTypeManager import com.atlassian.jira.issue.IssueInputParameters import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.issuetype.IssueType import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.issue.customfields.option.Options import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.customfields.manager.OptionsManager import com.atlassian.jira.issue.fields.CustomField import pt.i2s.jira.functions.CreateIssue import org.apache.log4j.Logger import org.apache.log4j.Level def log = Logger.getLogger("pt.i2s.jira.postfunction.CreateStories") log.setLevel(Level.DEBUG) ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() log.info("Aplication user") CustomFieldManager customFieldManager = ComponentAccessor.getComponent(CustomFieldManager); log.info("CustomFieldManager") OptionsManager optionsManager = ComponentAccessor.getComponent(OptionsManager); log.info("Options manager") CustomField storyType = customFieldManager.getCustomFieldObjectsByName("Story Type")[0] log.info("Strory type") CustomField epicLink = customFieldManager.getCustomFieldObjectsByName("Epic Link")[0] log.info("Epic Link") Options options = optionsManager.getOptions(storyType.getConfigurationSchemes().first().getOneAndOnlyConfig()); log.info("Options options") IssueService issueService = ComponentAccessor.getIssueService() log.info("Issue service") if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Functional Feature" || ((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Technical Feature") { log.info("ENTREI NO IF CRIACAO DE ISSUES") CreateIssue.createIssue("Analysis", user, storyType, options, issueService, epicLink, issue ) log.info("CRIAR ISSUE ANALYSIS") CreateIssue.createIssue("Development", user, storyType, options, issueService, epicLink, issue ) log.info("CRIAR ISSUE DEV") CreateIssue.createIssue("TestsSpec", user, storyType, options, issueService, epicLink, issue ) log.info("CRIAR ISSUE TSTSPEC") CreateIssue.createIssue("TestsExec", user, storyType, options, issueService, epicLink, issue ) log.info("CRIAR ISSUE TSTEXEC") CreateIssue.createIssue("Documentation", user, storyType, options, issueService, epicLink, issue ) log.info("CRIAR ISSUE DOC") CreateIssue.createIssue("Configuration", user, storyType, options, issueService, epicLink, issue ) log.info("End creating stories") } if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Functional Feature" || ((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Technical Feature") { log.info("ENTREI NO IF EPIC TYPE TECHNICAL/FUNCTIONAL FEATURE") if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Security Requirements")[0])) == "Yes" ){ log.info("ENTREI NO IF SECURITY REQUIREMENTS") CreateIssue.createIssue("Security", user, storyType, options, issueService, epicLink, issue ) } }

 

 

  • file scriptrunner "CreateIssue.groovy"

 

package pt.i2s.jira.functions import com.atlassian.jira.bc.issue.IssueService import com.atlassian.jira.config.IssueTypeManager import com.atlassian.jira.issue.IssueInputParameters import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.issuetype.IssueType import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.issue.customfields.option.Options import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.customfields.manager.OptionsManager import com.atlassian.jira.issue.fields.CustomField import org.apache.log4j.Logger import org.apache.log4j.Level import com.atlassian.jira.issue.customfields.option.Option; class CreateIssue{ static boolean createIssue(def type, ApplicationUser user, CustomField storyType, Options options, IssueService issueService ,CustomField epicLink, Issue issue){ def log = Logger.getLogger("pt.i2s.jira.functions.CreateIssue") log.setLevel(Level.DEBUG) log.info("Entrou Create Issue") //functional area //affects version //epic type CustomFieldManager customFieldManager = ComponentAccessor.getComponent(CustomFieldManager); CustomField lob = customFieldManager.getCustomFieldObjectsByName("LOB")[0] log.info("CRIA LOB") def lobValue = (Option)issue.getCustomFieldValue(lob) log.info("CRIA APPLICATION") CustomField software = customFieldManager.getCustomFieldObjectsByName("Application")[0] def softwareValue = (Option)issue.getCustomFieldValue(software) //log.info("APPLICATION CUSTOM FIELD: " + softwareValue.getValue()) //CustomField functionalArea = customFieldManager.getCustomFieldObjectsByName("Functional Area")[0]; //CustomField affectsVersion = customFieldManager.getCustomFieldObjectsByName("Affects Version/s")[0]; String selectedOptions = options.findAll { it.value == type }.collect { it.optionId }.first() log.info("SELECIONOU OPÇÕES") issue.getComponents() def myComponents=[]; for(component in issue.getComponents()){ log.info("A ITERAR NOS COMPONENTES") myComponents.add(component.getId() as long); } log.info("ITEROU NOS COMPONENTES") IssueInputParameters issueInputParameters = issueService.newIssueInputParameters(); log.info("BEGIN PARAMETERS") issueInputParameters .setProjectId( issue.getProjectObject().id ) .setSummary( issue.summary) .setDescription(issue.description) .setIssueTypeId("10001") .setReporterId(user.getName()) .setComponentIds(myComponents as Long[]) .addCustomFieldValue(storyType.id, selectedOptions) .addCustomFieldValue(epicLink.id, issue.key) log.info("END PARAMETERS") if(lobValue != null ){ log.info("VERIFICA LOB") issueInputParameters.addCustomFieldValue(lob.id, String.valueOf(lobValue.optionId)) } /* if(softwareValue != null){ log.info("VERIFICA SOFTWARE VALUE") issueInputParameters.addCustomFieldValue(software.id, String.valueOf(softwareValue.optionId)) log.info("SOFTWARE OPTION ID: " + String.valueOf(softwareValue.optionId)) } */ if(type == "Security"){ log.info("VERIFICA SECURITY") issueInputParameters.setAssigneeId("psantos") } if(type == "Configuration"){ log.info("VERIFICA CFG") issue.getAffectedVersions() def myAffectedV=[]; for(version in issue.getAffectedVersions()){ log.info("A ITERAR NOS AFFECTED VERSIONS") myAffectedV.add(version.getId() as long); log.info("affectedVersion: " + version.getName() + " Id: "+version.getId()); } log.info("ITEROU NOS AFFECTED VERSIONS") issueInputParameters.setAffectedVersionIds(myAffectedV as Long[]) } log.info("CRIA VALIDATION RESULT") IssueService.CreateValidationResult createValidationResult = issueService.validateCreate(user, issueInputParameters) log.info("ITERA NO VALIDATION RESULT") createValidationResult.getErrorCollection().getErrors().each{ key, value -> log.error( key +" : "+value) } if (createValidationResult.isValid()) { log.info("VALIDATION RESULT VALID") IssueService.IssueResult createResult = issueService.create( user, createValidationResult) log.info("CREATE RESULT: " + createResult.toString()) log.info("getIssue() do CreateResult: " + createResult.getIssue()) linkIssueToEpic(createResult.issue, issue, user, log) if (!createResult.isValid()) { log.error("CREATE RESULT NOT VALID") log.error( createResult.getErrorCollection()) return false; } }else{ log.error("Errors: "+createValidationResult.getErrorCollection().getErrorMessages().size()) log.error("Warnings: "+createValidationResult.getWarningCollection().getWarnings().size()) } return true } static boolean linkIssueToEpic(MutableIssue issue, Issue epicIssue, ApplicationUser user, Logger log) { log.info("A TENTAR LINKAR") def customFieldManager = ComponentAccessor.customFieldManager log.info("CRIOU CUSTOMER MANAGER") def issueManager = ComponentAccessor.issueManager log.info("CRIOU O ISSUE MANAGER") log.info("ISSUE OBJECT: " + issue.getDescription()) def customFieldsObjects = customFieldManager.getCustomFieldObjects(issue) for(cF in customFieldsObjects){ log.info("CUSTOM FIELD VALUE: " + cF.toString()); } def epicLinkField = customFieldManager.getCustomFieldObjects(issue).find { it.name == 'Epic Link' } log.info("A SETTAR CUSTOM FIELD") issue.setCustomFieldValue(epicLinkField, epicIssue) log.info("A FAZER UPDATE DO ISSUE") issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false) return true } }

 

 

best regards,

Isabel Fonseca

 

2 answers

1 accepted

2 votes
Answer accepted
Tuncay Senturk _Snapbytes_
Community Champion
April 7, 2025

Hi @Isabel Fonseca 

 

I'm really sorry, but would you mind formatting your code using code blocks?

It’s a bit hard for us to read and understand it otherwise—after all, we're humans, not machines 🙂

0 votes
Isabel Fonseca April 8, 2025
Hello,
  • 0) situation description
I have jira data center v9.12.7, and i create a script runner for when create a issue son, fill  Affected Versions from the issue dad.
When user create an issue type epic, will be create sub-tasks, and one of those in type "Configuration" where i want fill "setAffectedVersionIds", but the sub-task don't stay filled. Could you helpme please ?
Important note: the files scriptrunner "CreateStories.groovy" and "CreateIssue.groovy" , are successfully working, except the system field "AffectedVersion" that is not being filled .
In logs apears filled:
"
(...)
2025-04-07T16:02:09,187 INFO [functions.CreateIssue]: Entrou Create Issue
2025-04-07T16:02:09,187 INFO [functions.CreateIssue]: CRIA LOB
2025-04-07T16:02:09,187 INFO [functions.CreateIssue]: CRIA APPLICATION
2025-04-07T16:02:09,187 INFO [functions.CreateIssue]: SELECIONOU OPÇÕES
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: A ITERAR NOS COMPONENTES
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: ITEROU NOS COMPONENTES
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: BEGIN PARAMETERS
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: END PARAMETERS
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: VERIFICA CFG
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: A ITERAR NOS AFFECTED VERSIONS
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: affectedVersion: 6.20 Id: 26121
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: ITEROU NOS AFFECTED VERSIONS
2025-04-07T16:02:09,188 INFO [functions.CreateIssue]: CRIA VALIDATION RESULT
(...)
"
  • 1) file scriptrunner "CreateStories.groovy" 
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.config.IssueTypeManager
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.issuetype.IssueType
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.fields.CustomField
import pt.i2s.jira.functions.CreateIssue
import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("pt.i2s.jira.postfunction.CreateStories")
log.setLevel(Level.DEBUG)
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.info("Aplication user")
CustomFieldManager customFieldManager = ComponentAccessor.getComponent(CustomFieldManager);
log.info("CustomFieldManager")
OptionsManager optionsManager = ComponentAccessor.getComponent(OptionsManager);
log.info("Options manager")
CustomField storyType = customFieldManager.getCustomFieldObjectsByName("Story Type")[0]
log.info("Strory type")
CustomField epicLink = customFieldManager.getCustomFieldObjectsByName("Epic Link")[0]
log.info("Epic Link")
Options options = optionsManager.getOptions(storyType.getConfigurationSchemes().first().getOneAndOnlyConfig());
log.info("Options options")
IssueService issueService = ComponentAccessor.getIssueService()
log.info("Issue service")
if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Functional Feature" 
|| ((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Technical Feature") {
log.info("ENTREI NO IF CRIACAO DE ISSUES")
CreateIssue.createIssue("Analysis", user, storyType, options, issueService, epicLink, issue )
log.info("CRIAR ISSUE ANALYSIS")
CreateIssue.createIssue("Development", user, storyType, options, issueService, epicLink, issue )
log.info("CRIAR ISSUE DEV")
CreateIssue.createIssue("TestsSpec", user, storyType, options, issueService, epicLink, issue )
log.info("CRIAR ISSUE TSTSPEC")
CreateIssue.createIssue("TestsExec", user, storyType, options, issueService, epicLink, issue )
log.info("CRIAR ISSUE TSTEXEC")
CreateIssue.createIssue("Documentation", user, storyType, options, issueService, epicLink, issue )
log.info("CRIAR ISSUE DOC")
CreateIssue.createIssue("Configuration", user, storyType, options, issueService, epicLink, issue )
log.info("End creating stories")
}
if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Functional Feature" 
|| ((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Epic Type")[0])) == "Technical Feature") {
log.info("ENTREI NO IF EPIC TYPE TECHNICAL/FUNCTIONAL FEATURE")
if(((String)issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectsByName("Security Requirements")[0])) == "Yes" ){
log.info("ENTREI NO IF SECURITY REQUIREMENTS")
CreateIssue.createIssue("Security", user, storyType, options, issueService, epicLink, issue )
}
}
  • 2) file scriptrunner "CreateIssue.groovy", called by file scriptrunner "CreateStories.groovy" 

 

package pt.i2s.jira.functions
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.config.IssueTypeManager
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.issuetype.IssueType
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.fields.CustomField
import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.issue.customfields.option.Option;
class CreateIssue{
static boolean createIssue(def type, ApplicationUser user,  CustomField storyType, Options options, IssueService issueService ,CustomField epicLink, Issue issue){
   
def log = Logger.getLogger("pt.i2s.jira.functions.CreateIssue")
log.setLevel(Level.DEBUG)
log.info("Entrou Create Issue")
//functional area
//affects version
//epic type
CustomFieldManager customFieldManager = ComponentAccessor.getComponent(CustomFieldManager);
CustomField lob = customFieldManager.getCustomFieldObjectsByName("LOB")[0]
log.info("CRIA LOB")
def lobValue = (Option)issue.getCustomFieldValue(lob)
log.info("CRIA APPLICATION")
CustomField software = customFieldManager.getCustomFieldObjectsByName("Application")[0]
def softwareValue  =  (Option)issue.getCustomFieldValue(software)
//log.info("APPLICATION CUSTOM FIELD: " + softwareValue.getValue())
//CustomField functionalArea = customFieldManager.getCustomFieldObjectsByName("Functional Area")[0];
//CustomField affectsVersion = customFieldManager.getCustomFieldObjectsByName("Affects Version/s")[0];
String selectedOptions = options.findAll {
it.value == type
}.collect {
it.optionId
}.first()
log.info("SELECIONOU OPÇÕES")
issue.getComponents()
def myComponents=[];
for(component in issue.getComponents()){
log.info("A ITERAR NOS COMPONENTES")
myComponents.add(component.getId() as long);
}
log.info("ITEROU NOS COMPONENTES")
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
log.info("BEGIN PARAMETERS")
issueInputParameters
.setProjectId( issue.getProjectObject().id )
.setSummary( issue.summary)
.setDescription(issue.description)
.setIssueTypeId("10001")
.setReporterId(user.getName())
.setComponentIds(myComponents as Long[])
.addCustomFieldValue(storyType.id, selectedOptions)
.addCustomFieldValue(epicLink.id, issue.key)
log.info("END PARAMETERS")
if(lobValue != null ){
log.info("VERIFICA LOB")
issueInputParameters.addCustomFieldValue(lob.id, String.valueOf(lobValue.optionId))
}
/*
if(softwareValue != null){
log.info("VERIFICA SOFTWARE VALUE")
issueInputParameters.addCustomFieldValue(software.id, String.valueOf(softwareValue.optionId))
log.info("SOFTWARE OPTION ID: " + String.valueOf(softwareValue.optionId))
}
*/
if(type == "Security"){
log.info("VERIFICA SECURITY")
issueInputParameters.setAssigneeId("psantos")
}
if(type == "Configuration"){
log.info("VERIFICA CFG")
issue.getAffectedVersions()
def myAffectedV=[];
for(version in issue.getAffectedVersions()){
log.info("A ITERAR NOS AFFECTED VERSIONS")
myAffectedV.add(version.getId() as long);
log.info("affectedVersion: " + version.getName() + " Id: "+version.getId());
}
log.info("ITEROU NOS AFFECTED VERSIONS")
 
issueInputParameters.setAffectedVersionIds(myAffectedV as Long[])
}
log.info("CRIA VALIDATION RESULT")
IssueService.CreateValidationResult createValidationResult =
issueService.validateCreate(user, issueInputParameters)
log.info("ITERA NO VALIDATION RESULT")
createValidationResult.getErrorCollection().getErrors().each{ key, value ->
log.error( key +" : "+value)
}
   
if (createValidationResult.isValid())
{
log.info("VALIDATION RESULT VALID")
IssueService.IssueResult createResult = issueService.create(
user, createValidationResult)
log.info("CREATE RESULT: " + createResult.toString())
log.info("getIssue() do CreateResult: " + createResult.getIssue())
linkIssueToEpic(createResult.issue, issue, user, log)
if (!createResult.isValid())
{
log.error("CREATE RESULT NOT VALID")
log.error( createResult.getErrorCollection())
   
return false;
}
}else{
log.error("Errors: "+createValidationResult.getErrorCollection().getErrorMessages().size())
log.error("Warnings: "+createValidationResult.getWarningCollection().getWarnings().size())
}
return true
}
static boolean linkIssueToEpic(MutableIssue issue, Issue epicIssue, ApplicationUser user, Logger log)
{
log.info("A TENTAR LINKAR")
def customFieldManager = ComponentAccessor.customFieldManager
log.info("CRIOU CUSTOMER MANAGER")
def issueManager = ComponentAccessor.issueManager
log.info("CRIOU O ISSUE MANAGER")
log.info("ISSUE OBJECT: " + issue.getDescription())
def customFieldsObjects = customFieldManager.getCustomFieldObjects(issue)
for(cF in customFieldsObjects){
log.info("CUSTOM FIELD VALUE: " + cF.toString());
}
def epicLinkField = customFieldManager.getCustomFieldObjects(issue).find { it.name == 'Epic Link' }
log.info("A SETTAR CUSTOM FIELD")
issue.setCustomFieldValue(epicLinkField, epicIssue)
log.info("A FAZER UPDATE DO ISSUE")
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
return true
}
}
Best regards,
Isabel Fonseca
Tuncay Senturk _Snapbytes_
Community Champion
April 8, 2025

Ok, thanks. I am not sure but here is a suggestion.

Change your current code section in CreateIssue.groovy from:

if(type == "Configuration"){
log.info("VERIFICA CFG")
issue.getAffectedVersions()
def myAffectedV=[];
for(version in issue.getAffectedVersions()){
log.info("A ITERAR NOS AFFECTED VERSIONS")
myAffectedV.add(version.getId() as long);
log.info("affectedVersion: " + version.getName() + " Id: "+version.getId());
}
log.info("ITEROU NOS AFFECTED VERSIONS")

issueInputParameters.setAffectedVersionIds(myAffectedV as Long[]) // <- And here too
}

to

if(type == "Configuration"){
log.info("VERIFICA CFG")
def myAffectedV = issue.affectedVersions.collect { version ->
log.info("affectedVersion: ${version.name} Id: ${version.id}")
version.id.toString()
}
log.info("ITEROU NOS AFFECTED VERSIONS")

issueInputParameters.setAffectedVersionIds(myAffectedV as String[])
}

I wonder if it's related to a type problem, changing long to string may help.

Isabel Fonseca April 8, 2025

Hi @Tuncay Senturk _Snapbytes_ ,

Log "

2025-04-08T18:43:27,696 INFO [functions.CreateIssue]: VERIFICA CFG
2025-04-08T18:43:27,699 INFO [functions.CreateIssue]: affectedVersion: 2.0 Id: 29508
2025-04-08T18:43:27,700 INFO [functions.CreateIssue]: ITEROU NOS AFFECTED VERSIONS
2025-04-08T18:43:27,753 ERROR [workflow.AbstractScriptWorkflowFunction]: Workflow script has failed on issue CODE-211095 for user 'i2sifo'. View here: https://jiraserver.i2s.pt/jira-testes/secure/admin/workflows/ViewWorkflowTransition.jspa?workflowMode=live&workflowName=IMPDEV+Epic+Workflow&descriptorTab=postfunctions&workflowTransition=1&highlight=4
groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.IssueInputParametersImpl.setAffectedVersionIds() is applicable for argument types: ([Ljava.lang.String;) values: [[29508]]
Possible solutions: setAffectedVersionIds([Ljava.lang.Long;), getAffectedVersionIds()
at pt.i2s.jira.functions.CreateIssue.createIssue(CreateIssue.groovy:117) ~[?:?]
at pt.i2s.jira.functions.CreateIssue$createIssue.call(Unknown Source) ~[?:?]
at CreateStories.run(CreateStories.groovy:52) ~[?:?]
Start of logs truncated as they exceeded 300 lines."

CaptureError.JPG

If you have any further suggestions for resolution, please share.

 

 

When I manage to solve it, I'll let you know.

Regards,

Isabel Fonseca

Tuncay Senturk _Snapbytes_
Community Champion
April 8, 2025

Ok, another version :)

if(type == "Configuration"){
log.info("VERIFICA CFG")

def affectedVersions = issue.affectedVersions
def versionIds = affectedVersions.collect { version ->
log.info("affectedVersion: ${version.name} Id: ${version.id}")
version.id as Long
}

log.info("ITEROU NOS AFFECTED VERSIONS")

issueInputParameters.setAffectedVersionIds(versionIds as Long[])
}
Like Isabel Fonseca likes this
Isabel Fonseca April 9, 2025

Hi @Tuncay Senturk _Snapbytes_ ,
After testing, I see that it doesn't work:
20250409_log.JPG20250409.JPG

Original print:

20250409_OriginalPrint.JPG

Regards

Isabel Fonseca

Isabel Fonseca April 9, 2025

Hi,
Good news, it's resolved.
The situation was caused because I should add the field in the screen scheme of issue type Story (son).

screenscheme.JPG
Many thanks,
Best regards,
Isabel Fonseca

Tuncay Senturk _Snapbytes_
Community Champion
April 9, 2025

That's good news. I'm glad you resolved the problem.

Like Isabel Fonseca likes this

Suggest an answer

Log in or Sign up to answer