Recent searches


No recent searches

Miroslaw Sztorc's Avatar

Miroslaw Sztorc

Joined May 07, 2023

·

Last activity May 08, 2023

Following

0

Followers

0

Total activity

3

Vote

1

Subscription

1

ACTIVITY OVERVIEW

Latest activity by Miroslaw Sztorc

Miroslaw Sztorc created a post,

Post Developer - Zendesk Apps Framework (ZAF)

Hello everyone!

I'm trying to add two custom fields defined in the requirements.json file to a custom view that is set in the same file by passing the ticket field property key. For instance:

{
  "ticket_fields": {
    "support_description": {
      "type": "text",
      "title": "Support description"
    },
    "number_of_issues": {
      "type": "integer",
    "title": "Number of issues"
    }
  },
  "views": {
  "view_tickets_updated": {
      "active": true,
      "conditions": {
        "all": [
          {
            "field": "status",
            "operator": "less_than",
          "value": "solved"
          },
          {
            "field": "assignee_id",
            "operator": "is",
            "value": "current_user"
          }
        ],
        "any": []
      },
      "default": false,
    "description": "Tickets updated",
      "output": {
      "columns": ["status", "requester", "number_of_issues", "support_description", "assignee"],
        "group_by": "assignee",
        "group_order": "desc",
        "sort_by": "status",
        "sort_order": "desc"
      },
    "title": "Tickets updated <12 Hours"
    }
  }
}

According to the documentation, this should be possible using dependent app requirements:

Some required resources, such as triggers or views, may depend on other resources in requirements.json. In these cases, use the resource's property key wherever the equivalent API payload would use the resource's id.

https://developer.zendesk.com/documentation/apps/app-developer-guide/apps_requirements/

However, in the documentation, we can find only a sample configuration with a reference for a custom target (an_email_target) by passing email target's property key when defining an action for the trigger.

 For example, the following requirements.json file declares an email target and a trigger. The trigger references the email target's property key.

{
  "targets": {
    "an_email_target": {
      "title": "A sample email Target",
      "type": "email_target",
      "email": "foo@bar.com",
      "subject": "Hello, from this target!"
    }
  },
  "triggers": {
    "email_on_ticket_solved": {
      "title": "Email on ticket solved Trigger",
      "all": [
        {
          "field": "status",
          "operator": "is",
          "value": "solved"
        }
      ],
      "actions": [
        {
          "field": "notification_target",
          "value": ["an_email_target", "Ticket {{ticket.id}} has been updated."]
        }
      ]
    }
  }
}

Can I use the same approach for columns when defining views and referencing custom fields using property keys? Thanks!

Posted May 07, 2023 · Miroslaw Sztorc

2

Followers

4

Votes

2

Comments