Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
329 views
in Technique[技术] by (71.8m points)

automation - jira api calls from Confluence

Use-case: I've created a QA-monitoring confluence page used to check QA statistics for different product teams. Multiple Jira API-calls are made related to Incidents, Sprint-bugs, Total user-stories, Overall requirement coverage, Total automation/manual tests etc. Please see the code sample below. ~1200 api-calls are made in ~1.5 minutes. Afterwards, I'm populating the confluence page with relevant data.

Questions:

  1. How to show ajax-wait-like-gifs to the inform the user to wait until page load?
  2. For pageload time optimization, how to use jquery-promises? (any example). Any best practices? Thanks in advance
$.each(teams, function (index, value) {
    // Defect or Bugs
    AJS.$.ajax({
        url: `${JIRA_REST_URL}${PROJECT}${value}${DEFECTS}${DURATION}${MAX_RES}`,
        type: "GET",
        success: function (data) {
            if (document.getElementById(`${value}_DEFECTS`) != null) {
                document.getElementById(`${value}_DEFECTS`).innerHTML = JSON.parse(JSON.stringify(data)).total;
            }
        },
        error: function (err) {
            console.log(err)
        }
    });
});
$.each(product_teams, function () {
    $.each(this, function (name, value) {
        // Incidents
        AJS.$.ajax({
            url: `${JIRA_REST_URL}${INCIDENTS}${value}${QUOT}${DURATION}${MAX_RES}`,
            type: "GET",
            success: function (data) {
                if (document.getElementById(`${name}_INCIDENTS`) != null) {
                    document.getElementById(`${name}_INCIDENTS`).innerHTML = JSON.parse(JSON.stringify(data)).total;
                }
            },
            error: function (err) {
                console.log(err)
            }
        });
    });
});
....
question from:https://stackoverflow.com/questions/65643061/jira-api-calls-from-confluence

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...