Forum Discussion

keithkelly's avatar
2 years ago

Possible? Display 30-day FRT on a Board Component?

Our Board Oversight teams would like a component on their boards that displays the First Response Time (FRT) average over the past 30 days. 

While I realize I can grab this in Community Analytics, and I also am comfortable around the API... I'm a bit of a newbie when it comes to grabbing time-constrained data via the API

Here's the board component with the line in question:

<#if userHasApplicableRole>  
              
  <#assign frt = [30_DAY_BOARD_FRT_AVG] />  <#-- this -->  
  
  <div class="dc-boardwidget-FRT" title="FRT 30-day average">
    <i class="fa-regular fa-reply-clock"></i>
    <span>${frt}</span>
  </div>
  
</#if>

 

Is this possible with the API?

wkd-oliver 

3 Replies

  • Looks like you need this:

    ${restadmin("boards/id/${coreNode.id}/metrics/name/avg_thread_response_time?date_start=2023-01-01&date_end=2023-02-01").value}


    I might picked the wrong metric, but you can find the name of each by grabbing the value from url like
    /t5/bizapps/page/tab/community%3Aadmin%3Aanalytics-main%3Aadvanced-metrics?board_selection=freelancers&date_range=3-12-2023%2C4-12-2023&granularity=Daily&metrics=avg_thread_response_time&metrics_scope=board&user_selection=Empty

    Dates can get weird, but you should be able to use the datesupport method

    datesupport.addMonth(-1)

     

  • keithkelly's avatar
    keithkelly
    Leader
    2 years ago

    Weird - this is returning the *total* Minutes to First Response (as showing on Community Admin Analytics) rather than the *avg*

    Even though my URL is asking for the average:

    Is there anything obviously wrong here that would case that?

    boards/id/PolicyInternal/metrics/name/avg_thread_response_time?date_start=2023-10-15&date_end=2023-11-15

  • keithkelly's avatar
    keithkelly
    Leader
    5 months ago

    Does this calculate "total" or "average" for you?  I ran into this issue again and this API metric is definitely still giving me the total 🤦