2
1
0

I am attempting to remove a group from the multi-group selector.  Trying to do it with labels.


if (nodeHelper.getLabel("customer_service") == null)  remove group.


How do we tell Jira to remote the group.  I have been able to assign the group, but nothing about removing.

  1. David Oosting

    Update:


    Using the following im unable to null out all groups assigned.


    if (replica.labels.findAll { it.label.startsWith("reassign") } && !replica.labels.findAll { it.label.startsWith("customer_") }) {

        issue.customFields."Group Assigned".value = null

    }


    Any Idea on how to just null the field you dont want?

  2. David Oosting

    Example of what im attempting to do.  For our Jira Cloud Instance, we want to reassign the ticket back to Customer Service in Zendesk.  So we add the group assigned to Customer Service along with the group that was assigned originally.


    When they CS team reassign back to Jira, we want the Customer Service Group to go away.

  3. Ariel Aguilar

    Hi David,

    I would consider to achieve this by doing a custom trigger to something like:

    With Exalate you can achieve it, but it will require advanced knowledge on doing API calls. Let me know if this works for you.

    Kind regards,

    Ariel

  4. David Oosting

    Hey Ariel,


    No this is for Jira, so you cant do a trigger.  What i have working right now, is to null out the group assigned.  My end goal is just remove the Customer Service Group and leave the original group assigned.



    if (replica.labels.findAll { it.label.startsWith("reassign") } && !replica.labels.findAll { it.label.startsWith("customer_") }) {

        issue.customFields."Group Assigned".value = null

        issue.customFields."Group Assigned".value ?: ["name":"Service Desk Team"]

    }


    We tried to add the array value back manually to see if it worked, and it does not.


  5. David Oosting

    Here is the local replica.  So we are trying to remove from the array the value with "name":"Customer Service"


    "customFields": {
          "Group Assigned": {
            "id": 10056,
            "name": "Group Assigned",
            "uid": "10056",
            "type": "UNHANDLED",
            "value": [
              {
                "name": "Customer Service",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"
              },
              {
                "name": "Service Desk Team",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Service+Desk+Team"
              }
            ]
          }
  6. Ariel Aguilar

    Sorry, I thought you were referring to Zendesk. Is this custom field a group picker? The payload says it is unhandled, is this custom field inserted by an external plugin?

    Kind regards,

    Ariel

  7. David Oosting

    Its a group picker, which assigns the ticket to a Jira Group to address.  Emails notifications to the group ... etc... etc...  Custom Field.  I had to create.

  8. Ariel Aguilar

    Hi David, 

    Have you checked on this? :

    https://docs.idalko.com/exalate/x/BoEAAg

    Kind regards,

    Ariel

  9. David Oosting

    We tried that:


        def restApiGroup = ["name":"Service Desk Team"]

        issue.customFields."Group Assigned".value = restApiGroup


    Could not update issue `58,775`: Field customfield_10056: Operation value must be an array of group objects. Check the documentation for more details.

  10. Ariel Aguilar

    Hi David,

    If you describe a bit more how you tried? What outgoing, Incoming scripts were used? Not sure if I understood what you are trying out here:

        def restApiGroup = ["name":"Service Desk Team"]
        issue.customFields."Group Assigned".value = restApiGroup

    Kind regards,

    Ariel

  11. David Oosting

    As you can see, the input coming in is a standard array:


    "customFields": {
          "Group Assigned": {
            "id": 10056,
            "name": "Group Assigned",
            "uid": "10056",
            "type": "UNHANDLED",
            "value": [
              {
                "name": "Customer Service",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Customer+Service"
              },
              {
                "name": "Service Desk Team",
                "self": "https://atlassian.net/rest/api/2/group?groupname=Service+Desk+Team"
              }
            ]
          }

    So what we are trying to do is remove the Value name: "Customer Service" or set the value to the second in the array.
    The issue.customFields."Group Assigned".value should be assigned to

    "value": [ {"name": "Service Desk Team", "self": "https://atlassian.net/rest/api/2/group?groupname=Service+Desk+Team" } ]


CommentAdd your comment...