Advertisement
atelbor

[GRVY] Custom Fields

Oct 7th, 2022
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*******************************/
  2. /*   GROOVY - Custom Fields    */
  3. /*******************************/
  4.  
  5. // Obtener el valor de un CustomField
  6. // Obtener el valor de un customField de un formulario (validador)
  7. // Obtener valor de un customField original (validador)
  8. // Setear el valor de un customField
  9.  
  10. /************************************************************************/
  11.  
  12. // Obtener el valor de un CustomField
  13. def requirementStatusKey = "customfield_20109"
  14. def requirementStatusCf = customFieldManager.getCustomFieldObject(requirementStatusKey)
  15. def requirementStatusValue = issue.getCustomFieldValue(requirementStatusCf)
  16. if ("Yes".equals(requirementStatusValue?.toString())) { .....
  17.  
  18. //// Opcion 2
  19. def requirementStatusValue = issue.getCustomFieldValue(requirementStatusCf) as String
  20. if ("Yes".equals(requirementStatusValue)) { ..... }
  21. /************************************/
  22.  
  23. // Obtener el valor de un customField de un formulario (validador)
  24. def coreLocalName = "CORE/LOCAL"
  25. def coreLocalFormValue = cfValues[coreLocalName]
  26. coreLocalFormValue?.contains("CORE")
  27. /************************************/
  28.  
  29. // Obtener valor de un customField original (validador)
  30. def currentValue = issue.getCustomFieldValue(regTestRequiredCf)
  31. def originalValue = originalIssue.getCustomFieldValue(regTestRequiredCf)
  32. /************************************/
  33.  
  34. // Setear el valor de un customField
  35. def requirementStatusKey = "customfield_20109"
  36. def requirementStatusCf = customFieldManager.getCustomFieldObject(requirementStatusKey)
  37. issue.setCustomFieldValue(requirementStatusCf , "New value")
  38. .....
  39. issueManager.updateIssue(userAdmin, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
  40. /************************************/
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement