Related to fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 08:34 PM
1. What is a Fix script?
2. What is the purpose of the fix script, and what will exactly do with the fix script?
3. What is the exact use of the fix script?
4. Tell me one real-time scenario for fix script?
I don't know about fix script (if you have any data, please attached to this one)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 08:38 PM - edited 12-04-2022 08:41 PM
Hello @Basha4 ,
Fix script is a background script which runs the in the background to perform ServiceNow server operations.
The main use of the script is to update or insert records from the background.
If you want to update any incident but you have an acl applied already or the field is read only you can still update from background.
The only exception is the data policy which can restrict fixscript from updating as well.
you can refer to below links as well:
https://developer.servicenow.com/blog.do?p=/post/training-scriptsbg/
Please mark as accept solution if it helps.
Br,
Nayan
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 08:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 08:52 PM
HI @Basha4
1. What is a Fix script?
⇒ just script to do something...
2. What is the purpose of the fix script, and what will exactly do with the fix script?
⇒The purpose is to fix some things like error datas in your instance.
what will it exactly do depends on what you write in the script.
3. What is the exact use of the fix script?
⇒ Fix some datas.
And the scripts can be managed and tested in the instance .
Although,you can do the same thing with scripts-background where you can write you script freely,
scripts-background can't manage or test the scripts,once you run , the effact to you data is happened.
4. Tell me one real-time scenario for fix script?
⇒ Bellow is a sample.
Your app had a bug and some records were not updated correctly.
You have to modify the datas in you instance ,
Then you can write a fix script to fix the data, you can first test the script until the script be correct,
finally you run the script and the datas get fixed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 08:58 PM
1. Fix script is a fixed script as name suggest and it gets stored in the "Fix script [sys_script_fix]" table
2. In case of scoped application we need to install or upgrade the app in the instance and need to run the script before or after the installation/upgradation. Fix script will help in doing that.
There is a field called Before in the fix script. If its checked then the fix script will run before installation/upgradation. If its not checked then the fix script will run after installation/upgradation.
AND
We can run the fix script manually also whenever needed using the "Run fix script" button on the fix script form. And if "Record for rollback" field is checked then we can rollback the tasks we have done in that fix script.
3. Explained in point 2 itself
4. Realtime scenario:
- After/before installation/upgradation of scoped app, we need to create some records in a table. Then we can write fix script with the code to create records in that table. Fix script will take care to create records in that table after/before installation/upgradation. If there is no fix script then we must need to create the records in the table manually and we need to wait for app to be installed or upgraded properly. That's a tedious process. Hence fix script eliminates the issue of creating records in table. Its not just creating records in table but we can do anything we want in the fix script.
- We can run the fix script manually as well. I have run the fix script manually to create some records in a table, if the the "Record for rollback" field is checked then we can remove those records from the table easily.
Please mark as correct answer if this answers your question.
ServiceNow Community Rising Star, Class of 2023