如何在Jenkins中获得全选按钮。?

如何在Jenkins中获得全选按钮。?,jenkins,Jenkins,如何在Jenkins中获得全选按钮。扩展选项中没有“全选”按钮。如果你选择一种产品,有多种服务 所以不要选择一个。我想选择所有选项。如何在Jenkins中获得全选选项。您可以创建一个带有两个单选按钮选项的活动选项参数(名称=选择): 全选 清除所有 使用groovy脚本: return[ 'Select all:selected', 'Clear all' ] import hudson.model.* def result = [prod1,prod2,prod3]; def returnV

如何在Jenkins中获得全选按钮。扩展选项中没有“全选”按钮。如果你选择一种产品,有多种服务
所以不要选择一个。我想选择所有选项。如何在Jenkins中获得全选选项。

您可以创建一个带有两个单选按钮选项的活动选项参数(名称=选择):

  • 全选
  • 清除所有
  • 使用groovy脚本:

    return[
    'Select all:selected',
    'Clear all'
    ]
    
    import hudson.model.*
    def result = [prod1,prod2,prod3];
    def returnValue = [];
    if(Selection.equals("Select all"))
    {
       result.each{prod->
       returnValue<<prod+":selected";
       }
       return returnValue;
    }
    else if(Selection.equals("Clear all"))
    {
       return result;
    }
    
    对于您的产品,现在可以通过复选框使用Active Choice无功参数。您在活动选项参数中的选择将在此参数中产生反应

    使用groovy脚本:

    return[
    'Select all:selected',
    'Clear all'
    ]
    
    import hudson.model.*
    def result = [prod1,prod2,prod3];
    def returnValue = [];
    if(Selection.equals("Select all"))
    {
       result.each{prod->
       returnValue<<prod+":selected";
       }
       return returnValue;
    }
    else if(Selection.equals("Clear all"))
    {
       return result;
    }
    
    导入hudson.model*
    def结果=[prod1、prod2、prod3];
    def returnValue=[];
    if(Selection.equals(“全选”))
    {
    结果。每个{prod->
    返回值