Recent searches


No recent searches

Albin Nilsson af Sillén's Avatar

Albin Nilsson af Sillén

Joined Sep 18, 2023

·

Last activity Feb 15, 2024

Following

0

Followers

0

Total activity

21

Votes

3

Subscriptions

7

ACTIVITY OVERVIEW

Latest activity by Albin Nilsson af Sillén

Albin Nilsson af Sillén created a post,

Post Developer - Zendesk SDKs

Hi all

Am building a portal customization for a customer.

In order to so I need to do an api call using the userId of the looged in user.

Have only found this; https://developer.zendesk.com/api-reference/help_center/help-center-templates/helpers/#user_name-helper

However that is not relevant as I must have a uniqe identifier, either a ID or an email?

Is that possible?

Posted Feb 15, 2024 · Albin Nilsson af Sillén

0

Followers

2

Votes

0

Comments


Albin Nilsson af Sillén commented,

Community comment Developer - Zendesk APIs

This project was delivered after some time, did manage to solve the attachmnet as well.

View comment · Posted Dec 13, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

CommentUsing themes and customizing your Help Center

Is there a way to ex: use .env files for storing api keys securly in a custom page or any way to not show all the code (that is visible in the sources tab)?

View comment · Posted Dec 13, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

CommentUsing themes and customizing your Help Center

Hi all

Am alo stuck on this,
Have done the:
 profiles:list
 Subdomains

Where I got my subdomain.

Am able to log in using the SSO approach with /token. 

My code that I work with is a clone of the github Copenhagen repo https://github.com/zendesk/copenhagen_theme

Did also add the the new line as Adrian Martin mentioned above.






View comment · Posted Dec 08, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

Community comment Developer - Zendesk APIs

Hi all

Are you able to bulk_import fields from type: tagger and multiselect?
Am using the ticket import endpoint ticket/import/create_many

Have successfull done bulk_import on text fields, however the values for the tagger is not being added?

My tagger field that I want to uopdate looks like this after JSON.stringify;
{"id":,"value":["changing_distribution_"]}

Meanwhile, the trigger documentation states this;
"Single-select dropdown menu. It contains one or more tag values belonging to the field's options. Example: ( {"id": 21938362, "value": ["hd_3000", "hd_5555"]})"


   

View comment · Posted Nov 01, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

Community comment Developer - Zendesk APIs

ping!

View comment · Posted Oct 13, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén created a post,

Post Developer - Zendesk APIs

Hi all

Am currently working in a project where I need to bulk import tickets from one Zendesk account into another.

Am using this endpoint to get tickets:

/incremental/tickets/cursor.json?start_time=${unix_time}

As it is recommended from the docs (https://developer.zendesk.com/documentation/ticketing/managing-tickets/using-the-incremental-export-api/#cursor-based-incremental-exports)

Afterwards I do some maping where I search for requesters, assignee and submitters in their new environmnet based on the email from the old environment, then map this to the new userId in their new environment.

Morover, also do some maping related to fields, brand, groups etz.

This all work fine when I then add the tickets array to the endpoint: 
/imports/tickets/create_many
(https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_import/).

Which is a great endpoint as the customer wants to have the correct ticket metrics for created_at, solved etz.

However, am stuck on the attachmnet part of it, as I do need to upload attachmnet on comments to the new ticketId in the new environmnet. 

What is the best way to solve this?

Posted Oct 04, 2023 · Albin Nilsson af Sillén

1

Follower

3

Votes

3

Comments


Albin Nilsson af Sillén commented,

Community comment Developer - Zendesk APIs

Hi Christopher Kennedy

Thx for the reply. 

So in this case I will need 3 steps:

1. Download the file from the source Zendesk environmnet.
2. Upload the file and get the token towards the target Zendesk environmnet.
3. Attach the file to the ticket, again towards the target Zendesk environment.

Will this work when I am using the endpoint; /imports/tickets/create_many.
Do want to use this endpoint as I get the time metrics.

, Albin




View comment · Posted Oct 03, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

CommentAttachments and CCs

Hi Paolo

Thx for the reply.

Did make the suggested api calls using postman to get data for the attachment.

However, it does look very similair to the data returned from the endpoint: tickets/${ticket.id}/comments. The data returned from this call  was added to the tickets object before bulk import it. 
This creates a ticket with comments, but the attachment does not follow with.

Am i right to assume that if I use the Incremental Ticket Event Export, I can use this data to add both comments and attachment when doing the bulk import using the endpoint; imports/tickets/create_many

Thx again, Albin

 

View comment · Posted Sep 22, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments


Albin Nilsson af Sillén commented,

Community comment Developer - Zendesk APIs

Marcus Dawideit
Ken McCartney

Did you guys manage to solve this?

Am stuck on the same issue right now. My task is to import tickets from one Zendesk url to another Zendesk url.

Had no problem with using bulk import to create tickets with comments. However the attachment did not work.

Did ask the same query here
https://support.zendesk.com/hc/en-us/articles/4408887057946?page=1#comment_6162241414810


var axios = require('axios');

var dotenv = require('dotenv');

dotenv.config();

console.log('-----------------STARTING-----------------');

getTickets();

async function getTickets() {

  let currentPage = 1;

  // to be added back when scalling the app with API rates solution

  // url: `${url}/tickets.json?page=${currentPage}`,

  try {

    while (true) {

      const config = {

        method: 'GET',

        url: `${process.env.albinURL}/tickets`,

        headers: {

          'Content-Type': 'application/json',

          Authorization: `${process.env.albinAuth}`,

        },

      };

      const response = await axios(config);

      const ticketsData = response.data.tickets.slice(1, 2); // test ticket with attachmnet

      // to be added back when scalling the app with API rates solution

      // if (ticketsData.length === 0) {

      //   // No more tickets on this page, break the loop

      //   break;

      // }

      console.log('Page nr:', currentPage);

      console.log('Number of tickets on this page:', ticketsData.length);

      console.log('Total tickets from page', response.data.count);

      await setTags(ticketsData);

      await getComments(ticketsData);

      // const data = JSON.stringify({ tickets: ticketsData });

      // const isSuccess = await createTicket(data);

      // if (isSuccess) {

      getToken(ticketsData);

      // }

      // // to be added back when scalling the app with API rates solution

      // console.log(isSuccess);

      // if (res) {

      //   currentPage++;

      // } else {

      //   break;

      // }

      break;

      console.log('-----------------ENDING-----------------');

    }

  } catch (error) {

    console.log('Error:', error);

  }

}

async function createTicket(data) {

  console.log('CREATING TICKETS');

  var config = {

    method: 'POST',

    url: `${process.env.albinURL}/imports/tickets/create_many`,

    headers: {

      'Content-Type': 'application/json',

      Authorization: `${process.env.albinAuth}`,

    },

    data: data,

  };

  try {

    const response = await axios(config);

    console.log(response);

    console.log(response.status);

    return response.status === 200;

  } catch (error) {

    console.log(error.response.data);

    console.log('ERROR');

    return false;

  }

}

function setTags(ticketData) {

  ticketData.forEach((ticket) => {

    const modifiedData = {

      ...ticket,

      tags: ticket.tags

        ? [...ticket.tags, `FINID:${ticket.id}`]

        : [`FINID:${ticket.id}`],

    };

    // Update the original ticket with the modifiedData

    Object.assign(ticket, modifiedData);

  });

}

async function getComments(ticketData) {

  for (let i = 0; i < ticketData.length; i++) {

    const ticket = ticketData[i];

    try {

      const response = await axios({

        method: 'GET',

        url: `${process.env.albinURL}/tickets/${ticket.id}/comments`,

        headers: {

          'Content-Type': 'application/json',

          Authorization: `${process.env.albinAuth}`,

        },

      });

      // Add comments to the ticket

      ticket.comments = response.data.comments;

    } catch (error) {

      console.error(`Error fetching comments for ticket ${ticket.id}:`, error);

    }

  }

}

function getToken(tickets) {

  tickets.forEach((ticket) => {

    console.log(`TicketID: ${ticket.id}`);

    ticket.comments.forEach((comments) => {

      if (comments.attachments.length > 0) {

        comments.attachments.forEach((comment) => {

          console.log(comment.file_name);

          console.log(comment.content_type);

          console.log(comment.url);

        });

      } else {

        console.log('No attachmnet to this comment');

      }

    });

  });

}




View comment · Posted Sep 18, 2023 · Albin Nilsson af Sillén

0

Followers

0

Votes

0

Comments