(Day 2) ServiceNow Scenario-Based Interview Questions | Close Parent Incident upon Child Closure"

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 50

  • @sivavani1188
    @sivavani1188 5 หลายเดือนก่อน

    Thanks ravi for making such kind of videos. Its will be very helpful. Looking forward for more videos...

  • @alokkashyap3970
    @alokkashyap3970 6 หลายเดือนก่อน

    Best video. We need more

  • @Amba.traders89
    @Amba.traders89 8 หลายเดือนก่อน +2

    nice explanation

  • @shaiksameerbasha1361
    @shaiksameerbasha1361 7 หลายเดือนก่อน

    Thanks ravi for making thesekind of usecases. Looking forward for more vedios. 😊

  • @priteshfarate9716
    @priteshfarate9716 5 หลายเดือนก่อน +1

    Plz, check this one script... It will meet all conditions for the above requirement.
    Please let me know if I'm wrong...!
    It will also work on multiple child incidents. Should all the child incident state "Closed", then n only then this script will allow to change the parent incident state to "Closed". Otherwise not.
    BR: Before, Operation: Updates,
    Filter Condition: State changes to close.
    Script:
    (function executeRule(current, previous /*null when async*/ ) {
    var gr = new GlideRecord('incident');
    gr.addQuery('parent_incident', current.sys_id);
    gr.query();
    while (gr.next()) {
    if (gr.state != '7') {
    gs.addErrorMessage('Plz Close the all child incident n then u can change the state');
    current.setAbortAction(true);
    action.setRedirectURL(current);
    }
    }
    })(current, previous);

  • @PavanKalyan-qc2ln
    @PavanKalyan-qc2ln 3 หลายเดือนก่อน

    I have received similar requirement but when I used the business rule after abort action it was not staying on the same page.
    Again I have used ui action and it's fine. Could you please let me know what could be the reason

  • @gganga6633
    @gganga6633 5 หลายเดือนก่อน

    Hi Ravi,
    i have written the same code, however i am unable to close the child incident as well. Am i making any error in the code?
    (function executeRule(current, previous /*null when async*/) {
    var Inc=new GlideRecord('incident');
    Inc.addQuery('parent_incident',current.sys_id);
    Inc.query();
    if(Inc.next){
    if(Inc.state=='7'){
    gs.addInfoMessage("the child incident is closed");
    current.setAbortAction(false);
    }
    else{
    gs.addErrorMessage("the child incident is not closed");
    current.setAbortAction(true);
    }
    }
    })(current, previous);

    • @learnservicenowwithravi
      @learnservicenowwithravi  5 หลายเดือนก่อน

      Let me check

    • @baatyr_patta1068
      @baatyr_patta1068 3 หลายเดือนก่อน +1

      I found two bugs: 1) you need to add parentheses ( ) next to next method. It should be like this: if(Inc.next())
      2) your 'Inc' variable is written with CAPITAL 'I' which is not allowed for variable name. Change it to 'inc'.

  • @angelhues_bysmita3560
    @angelhues_bysmita3560 7 หลายเดือนก่อน

    If we have multiple child incidents in open state under that parent incident, then we need to first close all these child incidents to close the parent incident right? So how close the child incidents?

    • @learnservicenowwithravi
      @learnservicenowwithravi  7 หลายเดือนก่อน

      Check out all child linked to single parent and then close all child and then close parent

  • @makqdr6824
    @makqdr6824 7 หลายเดือนก่อน

    Hi Ravi, a quick question. Why do we need IF ELSE? can't we just write if (grinc.state != '7') current.setAbortAction(true);? Also in case of more than one children, can we get the count of child records where the ('parent_incident', current.sys_id) and child (grinc.state != '7') instead of looping? If yes, appreciate if you can share the logic. Thank you

  • @rahulnimsatkar429
    @rahulnimsatkar429 8 หลายเดือนก่อน

    Sir can you tell me how I convert knowledge article in service into the json body

  • @luciferpinny2676
    @luciferpinny2676 8 หลายเดือนก่อน +1

    Hi Ravi, i didn't get the script clearly.... because, you have written business rules in incident table, then why are you glide recording incident table again??? And also inc.state ==7 , this means, which state it is taking in incident table like, parent incident state or child incident state.....if it is taking child incident state, then how to we know it is taking child incident state

    • @learnservicenowwithravi
      @learnservicenowwithravi  8 หลายเดือนก่อน +1

      I glide because i have to check if parent incident has a child..i glide only once because i need to get parent_incident field..

  • @PhysicsCoshi
    @PhysicsCoshi 4 หลายเดือนก่อน

    Hi Ravi, will it work the same if we have an incident task instead of a child incident?

  • @SwapnaSreeKaruna
    @SwapnaSreeKaruna 2 หลายเดือนก่อน

    hi Ravi, Why the info message or Error message haven't displayed?

    • @learnservicenowwithravi
      @learnservicenowwithravi  2 หลายเดือนก่อน

      Which time stamp can you tell

    • @SwapnaSreeKaruna
      @SwapnaSreeKaruna 2 หลายเดือนก่อน

      ThE messages you mentioned in the code did not appear like this is child incident....😊that's ok... thanks for the video.

  • @gurusalivahan3262
    @gurusalivahan3262 8 หลายเดือนก่อน

    Hi Ravi ,
    Thanks for sharing the interview questions
    One update in the script
    In else condition please update the error message syntax
    Three times message is added ,due to this else condition is not working and it shows as invalid update.
    Thank you

    • @gurusalivahan3262
      @gurusalivahan3262 8 หลายเดือนก่อน

      Add info message as well

    • @learnservicenowwithravi
      @learnservicenowwithravi  8 หลายเดือนก่อน

      Share your script

    • @gurusalivahan3262
      @gurusalivahan3262 8 หลายเดือนก่อน

      @@learnservicenowwithravi
      Hi Ravi , below is the script.
      When before update record
      Cond:
      State changes
      (function executeRule(current, previous /*null when async*/) {
      var inc = new GlideRecord('incident');
      inc.addQuery('parent_incident', current.sys_id);
      inc.query();
      if (inc.next()) {
      if (inc.state == '7') {
      gs.addInfoMessage("This is child incident and the state is close ");
      current.setAbortAction(false); // misson successfull
      } else {
      gs.addErrorMessage("Child Incident is not closed,please close the child incident before closing he parent ");
      current.setAbortAction(true);
      }
      }
      })(current, previous);

  • @epapra795
    @epapra795 8 หลายเดือนก่อน +3

    explaination is good, but one video for one scenario may take time. Please include three or four in one video

    • @learnservicenowwithravi
      @learnservicenowwithravi  8 หลายเดือนก่อน +2

      Sure noted 😀

    • @krishna1202
      @krishna1202 8 หลายเดือนก่อน +3

      Agree.. we can’t wait for ages to get decent questions 😂

  • @KrishnaVeni-k2c
    @KrishnaVeni-k2c 2 หลายเดือนก่อน

    how to get backend names all fields in doubble click

  • @kartik_official_5277
    @kartik_official_5277 8 หลายเดือนก่อน

    Hello sir , 5 may of my CSA exam so, you would like to provide me important questions for crack my CSA exam . because your explanation is very good 👍👍
    i like that.please sir provide me important questions for CSA (service now) Exam🙏🙏

    • @learnservicenowwithravi
      @learnservicenowwithravi  8 หลายเดือนก่อน

      drive.google.com/file/d/1P2c5vc1zJvi1vzllEJFLcnl3ySsGw6RP/view?usp=drivesdk

    • @kartik_official_5277
      @kartik_official_5277 8 หลายเดือนก่อน

      ​@@learnservicenowwithravi Sir that is enough of a question for cracking the CSA exam.??

  • @priteshfarate9716
    @priteshfarate9716 5 หลายเดือนก่อน

    Plz check this one script... It will meet all conditions of the above requirements.
    correct me if I'm wrong... !
    BR: Before, Operation: Updates,
    Filter Condition: State changes to close.
    Script:
    (function executeRule(current, previous /*null when async*/ ) {
    var gr = new GlideRecord('incident');
    gr.addQuery('parent_incident', current.sys_id);
    gr.query();
    while (gr.next()) {
    if (gr.state != '7') {
    gs.addErrorMessage('Plz Close the all child incident n then u can change the state');
    current.setAbortAction(true);
    action.setRedirectURL(current);
    }
    }
    })(current, previous);

  • @PayalTripathy08
    @PayalTripathy08 8 หลายเดือนก่อน

    can you please share your google drive link?

  • @2PaweL
    @2PaweL 7 หลายเดือนก่อน +1

    +1

  • @astalkies9072
    @astalkies9072 8 หลายเดือนก่อน

    not sure why but else condition doesn't work
    var grinc = new GlideRecord('incident');
    grinc.addQuery('parent_incident', current.sys_id);
    grinc.query();
    if (grinc.next()) {
    if (grinc.state == '7')
    gs.addInfoMessage("child is in closed state");
    current.setAbortAction(false);
    } else {
    gs.addErrorMessage("child is NOT in closed state");
    current.setAbortAction(true);
    }
    Could you please validate

    • @yashwanthyash1464
      @yashwanthyash1464 7 หลายเดือนก่อน

      var grinc = new GlideRecord('incident');
      grinc.addQuery('parent_incident', current.sys_id);
      grinc.query();
      if (grinc.next()) {
      if (grinc.state == '7'){
      gs.addInfoMessage("child is in closed state");
      current.setAbortAction(false);
      } else {
      gs.addErrorMessage("child is NOT in closed state");
      current.setAbortAction(true);
      }
      }
      try this, you've missed to add braces after second if and closing of else.

  • @luciferpinny2676
    @luciferpinny2676 8 หลายเดือนก่อน

    And also, this example is for one child incident......if one incident have multiple child incidents then how we can write script ravi? I mean, how we can write query condition

    • @learnservicenowwithravi
      @learnservicenowwithravi  8 หลายเดือนก่อน +1

      Use while condition instead of if

    • @ferozkasim328
      @ferozkasim328 8 หลายเดือนก่อน

      I just love the way u teach us for us.very thanks for the info

  • @luciferpinny2676
    @luciferpinny2676 8 หลายเดือนก่อน

    Please help me ravi regarding this