Home Analyst Portal

Pop-up for a "special" RA

Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭

This is an odd user Request. They want a pop-up reminder (a simple JavaScript alert will do) when they navigate to the Activities tab and an RA with some "keywords" in the Title is In Progress.

The reasoning behind this, is that the Reviewers are supposed to check and verify certain data on the General and Related Config Items before Approving but many times forget. The follow-on automation will then fail. So they now want a pop-up "Have you checked your children?" before approving.

I'm TERRIBLE at JavaScript, btw, couldn't even determine if an RA with "keywords" was on the tab! Much less if it were In Progress status!

TIA

Best Answer

  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    Answer ✓

    @Brian_Winter

    probably not the best way to do it, but you could have something like this set to trigger off opening the activities tab

    $RATitleFound = 0;

    $testRATitles = $('div.activity-item-header span span span:contains("RA")').next();

    $testRATitlesStatus = $('div.activity-item-header span span span:contains("RA")').parent().parent().next()


    $numRATitles = $testRATitles.length;

    for ($i=0;$i<$numRATitles;$i++) {

    if ( $testRATitles[$i].textContent.indexOf("Manager Approval") > -1 && $testRATitlesStatus[$i].innerHTML.indexOf("In Progress") > -1 ) {

    $RATitleFound = 1;

    }

    }

    if ( $RATitleFound > 0 ) {

    alert("Approval RA Present");

    }

Answers

  • Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭

    Let's see if I can rephrase the question:

    Upon entering the Activities tab, if an RA with "keyword string" is in the Title and Status is In-Progress, can we trigger a JavaScript alert?

  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    Answer ✓

    @Brian_Winter

    probably not the best way to do it, but you could have something like this set to trigger off opening the activities tab

    $RATitleFound = 0;

    $testRATitles = $('div.activity-item-header span span span:contains("RA")').next();

    $testRATitlesStatus = $('div.activity-item-header span span span:contains("RA")').parent().parent().next()


    $numRATitles = $testRATitles.length;

    for ($i=0;$i<$numRATitles;$i++) {

    if ( $testRATitles[$i].textContent.indexOf("Manager Approval") > -1 && $testRATitlesStatus[$i].innerHTML.indexOf("In Progress") > -1 ) {

    $RATitleFound = 1;

    }

    }

    if ( $RATitleFound > 0 ) {

    alert("Approval RA Present");

    }

  • Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭

    Hi @Jeff_Lang , you nailed it!

    The line,

    $testRATitlesStatus = $('div.activity-item-header span span span:contains("RA")').parent().parent().next()
    

    didn't return any values, but,

    $testRATitlesStatus = $('div.activity-item-header span span span:contains("RA")').parent().parent()
    

    did have the "In Progess" string I was looking for.

    So we're done past Milestone 1. Now I'm going to see if I can

    1. get the popup to only display once per session and
    2. integrate this with SweetAlerts!!
  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭

    @Brian_Winter sounds like ours is slightly different due to other customizations we have running, good to know you found the required change to make it work your end

Sign In or Register to comment.