最近搜索
没有最近搜索

Albin Nilsson af Sillén
已加入2023年9月18日
·
最后活动2024年2月15日
关注
0
关注者
0
活动总数
21
投票
3
订阅
7
活动概览
标记
文章
帖子
社区评论
文章评论
活动概览
的最新活动 Albin Nilsson af Sillén
Albin Nilsson af Sillén 创建了一个帖子,
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?
已于 2024年2月15日 发布 · Albin Nilsson af Sillén
0
关注者
2
投票
0
评论
Albin Nilsson af Sillén 进行了评论,
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)?
查看评论 · 已于 2023年12月13日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论
Albin Nilsson af Sillén 进行了评论,
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.
查看评论 · 已于 2023年12月08日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论
Albin Nilsson af Sillén 进行了评论,
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"]})"
查看评论 · 已于 2023年11月01日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论
Albin Nilsson af Sillén 创建了一个帖子,
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:
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:
(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?
已于 2023年10月04日 发布 · Albin Nilsson af Sillén
1
关注者
3
投票
3
评论
Albin Nilsson af Sillén 进行了评论,
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
查看评论 · 已于 2023年10月03日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论
Albin Nilsson af Sillén 进行了评论,
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
查看评论 · 已于 2023年9月22日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论
Albin Nilsson af Sillén 进行了评论,
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');
}
});
});
}
查看评论 · 已于 2023年9月18日 发布 · Albin Nilsson af Sillén
0
关注者
0
投票
0
评论