كيف نتعامل مع شكاوى المستخدمين باستخدام JIRA (REST API)



في الوقت الحاضر ، هناك القليل من خدمات الويب أو التطبيقات التي تعمل بدون وظائف ، حيث يمكن للمستخدمين الشكوى (الإخطار ، الإبلاغ) عن أنواع مختلفة من المحتوى ، سواء كان خطأ نحويًا في النص ، أو صياغة خاطئة ، أو محتوى غير مثير للاهتمام أو غير إعلامي (مثل التمرين ، الدرس ، المقالة أو مواد تدريبية أو جزء من الوظيفة) . تعتبر القدرة على "الإبلاغ عن مشكلة" جزءًا لا يتجزأ من إشراك المستخدمين في المنتج ، وتنفيذ نموذج لجمع التعليقات ، والقدرة على تحسين تطبيقك ككل.



يجب تخزين جميع شكاوى المستخدم في مكان ما ، وتحديد الأولويات ، وتتبعها بسهولة ، علاوة على ذلك ، يجب معالجتها في الوقت المحدد. ولكن ليس من الممكن دائمًا تخصيص موارد كافية لتطوير وصيانة مثل هذا النظام ، لأنه سيكون هناك دائمًا مهمة في الأعمال المتراكمة ذات أولوية أعلى. أدناه سأخبرك كيف نجحنا في حل هذه المشكلة بكفاءة وسرعة في Uxcel باستخدام واجهة برمجة تطبيقات JIRA REST.



لماذا نحتاج إلى "الإبلاغ عن مشكلة"؟



— ?

Uxcel — - UI/UX . “” — 2 , , — . . (hint — ) (description) , .





— , - , - , , . “ ” , , . , , , , .





, backlog-, , JIRA + REST API.



JIRA



1 BUG JIRA Practices Reports. -. , Label ( : Course, Gym, UEye). :





, - ( ) .



.



JIRA REST API



API token JIRA, JIRA API. , , .



API :







  • -> Create




. - , .



API JIRA. , ( ) HTTP basic authentication.



( TypeScript NodeJS):



private generateAuthHeader(): string {
    //   email:apiToken  Base64
    const basicAuthValue = Buffer.from(`${this.jiraEmail}:${this.jiraApiToken}`).toString('base64'); 
    return `Basic ${basicAuthValue}`;
}


: AWS Secrets Manager. . .


API



. , Issue ID JIRA. — GET :



GET https://{id}.atlassian.net/rest/api/3/issuetype 


, Postman:





Authorization Type: Basic Auth, email api token.



:



{
    "self": "https://{id}.atlassian.net/rest/api/3/issuetype/10004",
    "id": "10001",
    "description": "A problem or error.",
    "iconUrl": "https://${id}.atlassian.net/secure/viewavatar?size=medium&avatarId=10303&avatarType=issuetype",
    "name": "Bug",
    "untranslatedName": "Bug",
    "subtask": false,
    "avatarId": 10303
}


Issue Id BUG (“10001”) Project Id, . id .



GET



GET https://{id}.atlassian.net/rest/api/3/project/search


: , (Jira Epic). id , Key ( , , UX-1).



API.



npm Got HTTP NodeJS.


await got.post({
    url: `${this.jiraApiHost}/issue`, // jiraApiHost = https://{id}.atlassian.net/rest/api/3
    headers: {
        Authorization: authorization, //  Basic Auth Header   generateAuthHeader
        'Content-Type': 'application/json'
    },
    responseType: 'json',
    json: {
        update: {},
        fields: {
            issuetype: { id: this.jiraBugTypeId }, //  id  BUG ( - ‘10001’)
            project: { id: this.jiraPracticeReportProjectId }, // id  ( - ‘10005’)
            parent: { key: this.jiraPracticeReportEpicKey }, //  Epic ( - UX-1)
            summary: practiceTicketName, //    -  [practiceId] practiceName (#reports)
            labels: [practice.label]
        }
    }
});


API Reference



. JIRA, : , , , .



API



API . , , .



:



//  JQL ,    BUG       id  (     )
const jql = `issuetype = Bug AND project = CNT AND parent = ${this.jiraEpicKey} AND text ~ "${practiceId}" order by created DESC`; 
const response = await got.get({
    url: `${this.jiraApiHost}/search?jql=${jql}`,
    headers: {
        Authorization: authorization
    },
    responseType: 'json'
});
const practiceJiraTicket = response.body['issues'] && response.body['issues'][0];


API Reference



, , CLOSED.



API



, Transitions. Status ID TODO / OPENED ( JIRA).



Postman:



GET https://{id}.atlassian.net/rest/api/3/project/{projectIdOrKey}/statuses


id , , id.



:



await got.post({
    url: `${this.jiraApiHost}/issue/${practiceJiraTicket.key}/transitions`, //  practiceJiraTicket -   
    headers: {
        Authorization: authorization,
        'Content-Type': 'application/json'
    },
    responseType: 'json',
    json: {
        transition: {
            id: this.jiraToDoStatusId // id    ( - ‘10006’)
        }
    }
});


API Reference



— ( , ).



API



, id . . , n — .



API :



await got.put({
    url: `${this.jiraApiHost}/issue/${practiceJiraTicket.key}`,
    headers: {
        Authorization: authorization,
        'Content-Type': 'application/json'
    },
    responseType: 'json',
    json: {
        update: {
            summary: [{ set: newPracticeTicketName }]
        }
    }
});


API Reference



.



API



-.



:



await got.post({
    url: `${this.jiraApiHost}/issue/${practiceJiraTicket.key}/comment`,
    headers: {
        Authorization: authorization,
        'Content-Type': 'application/json'
    },
    responseType: 'json',
    json: comment //     
});


API Reference



comment Atlassian Document Format.

Builder, : — JSON .



! , , , JIRA.



:





JIRA ( id, #N — , % — ):





. , :





! , :)

!




All Articles