Pop-up for a "special" RA
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_Lang Customer Ninja IT Monkey ✭✭✭✭
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");
}
1
Answers
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?
@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");
}
Hi @Jeff_Lang , you nailed it!
The line,
didn't return any values, but,
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
@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