ServiceNow-How to get a record (INCIDENT/REQUEST/CHANGE) - servicenow

Is there any common URL to navigate to serviceNow portal with number (INC/REQ/CHG)?
I have an common URL (INC/REQ/CHG) which can be navigated to ServiceNow portal by sys_id:
https://XXXXdev.service-now.com/nav_to.do?uri=task.do?sys_id=XXXXXXXXXXXXXXXXXXXXX
I have tried below URLs for incident but it is creating a new record
XXXXdev.service-now.com/nav_to.do?uri=incident.do?sysparm_order=INC0XXX
OR
XXXXdev.service-now.com/nav_to.do?uri=incident.do?number=INC00XXXX
No problem if there are different URLs for INC, REQ or CHG, I want a URL to see record by giving a number but not with sys_id.

From what you have described I believe you want:
https://[instance].service-now.com/incident.do?sysparm_query=number=INC1234567
https://[instance].service-now.com/sc_request.do?sysparm_query=number=REQ1234567
https://[instance].service-now.com/change_request.do?sysparm_query=number=CHG1234567
Or the catch all
https://[instance].service-now.com/task.do?sysparm_query=number=INC1234567
https://[instance].service-now.com/task.do?sysparm_query=number=REQ1234567
https://[instance].service-now.com/task.do?sysparm_query=number=CHG1234567
(see https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/use/navigation/concept/c_NavigatingByURL.html)
If you want to keep the outer frames of SN then use the nav_to.do?uri= version e.g.
https://[instance].service-now.com/nav_to.do?uri=sc_request.do?sysparm_query=number=REQ1234567
which is what #kirk has described.

You have a couple of options depending on what you're trying to do exactly.
Email
If you're trying to send this link in an email notification, you can use ${URI_REF} for the table that the notification is generated on.
This will automatically generate a link to the record.
You can also dot walk to another table, for example
Catalog Task up to the Requested Item ${request_item.URI_REF}
Current task up top the parent record ${parent.URI_REF}
Calculated
If you are looking to generate this based on some calculated method you can do this with the table name and the record number.
https://instance.service-now.com/nav_to.do?uri=/table_name.do?sysparm_que‌​ry=number=RECORD_NUMBER
For instance for a Change record with record number CHG0000123
https://instance.service-now.com/nav_to.do?uri=/change.do?sysparm_que‌​ry=number=CHG0000123
You may also reference a record by using a parent table, though this is more for an interesting note rather than a good practice. INC, REQ, and CHG all inherit from the Task table so you could do this.
https://instance.service-now.com/nav_to.do?uri=/task.do?sysparm_que‌​ry=number=CHG0000123
The drawback to using the parent table is that it won't have all fields and won't have the proper form layout. Mostly just an interesting exercise.
You may also leverage the text search and the system will pull up a record that matches the record number.
https://instance.service-now.com/nav_to.do?uri=/textsearch.do?sysparm_que‌​ry=number=CHG0000123
Note that this works out of the box and you could have configured search to not behave that way.
Business Rule
Another method inside of a Business Rule is to use the current.getLink() method. This will return a URL to the record. If you would like to add to a journal entry, you could use this
var currentLink = "[code]<a href='" + current.getLink() + "'>" + current.number + "</a>[/code]";
var journal = gs.getMessage("The new record is {0}", [currentLink]);
gr.work_notes = journalEntry;

Your initial URI will actually work with a NUMBER (like INC000001), assuming that number is actually the display field for the table (as it is by default):
https://XXXX.service-now.com/incident.do?sys_id=NUMBER
When you do a sys_id= lookup, we first lookup by the sys_id column. If it's not found there, we try a lookup on the display value (number), which will load the form exactly as you expect.

{yourinstance}.service-now.com/nav_to.do?uri=incident.do?sys_id={incidentNumber}
Replace incidentNumber with your incident number .

Related

Mris rets does not allow search by ListingKey

I have a list of ListingKeys that are updated since 2015-01-01
Then Id like to fetch all the metadata and values based on that field (listingKey). I'm expecting to search by arrays of listingKeys.
So my DMQL2 query is
(Listingkey=10026515129,10026515170,10039422998,10039789519,10039789557,10039789596,10262631304,10383785355,10383787516,10389025847)
And the response from MRIS is
[PHRETS\Exceptions\RETSException]
'Listingkey' is not a valid search item for SearchType = 'Property' and Class = 'MRIS Residential'.
I'm surprised that 'Listingkey' is not searchable, its unlikely because its unique and a primary key, if we want to sync our database we could easily do this by ListingKey.
I'd suggest using www.retsmd.com to verify that the 2nd parameter in your Search request is a valid class name under the Property resource. Unless the server is misreporting something, I'd doubt that "MRIS Residential" is the value you want for the 2nd parameter.
If you could paste the Search line you're using completely, that would help. I regularly pull listings by primary key from that server so I know the software is capable of it.

Identify if objects are the same

I want to check certain objects against each other and identify if they are the same.
For example, I need to verify that the total cost in one page is the same as another page. I developed a script that works, however the total cost changes every day so I have to update the object properties in maintenance mode every day.
Is there a way that UFT automatically recognizes this object must change and update?
I request you to elaborate your question. For now, you can use .* if certain values of the object are changing. Alternatively, you can store the values in an excel sheet and you can change everyday depending on the requirement.
If this is not helpful let me know
It sounds like you actually want to compare the values shown in two different objects, and see if those values are the same. (I assume this because you say they are on two different pages)
Also, you mention maintenance mode, so I assume you are using checkpoints to store their expected values.
I would suggest: instead of storing the expected values in a checkpoint, you could read the value of the first object (getROproperty), store it in a variable (dataTable field, environment variable, etc), and then navigate to the other page, read the ROproperty from the other object, and then compare.
i.e.
if {browser,page,object...}.getROproperty({whateverPropertyYouNeed}) = environment({storedFirstValue}) then
reporter.reportevent micPass,"compare step","{details here}"
end if
*replace stuff inside {} with your code, I don't know what it is
If you need to actually store the total cost externally, you could use a DataTable field and export the sheets at the end. then import the same sheet at the beginning. That would save the data to an excel sheet on a drive.

Count how many times one post has been read

Is it possible to show how many times one post has been read? In WordPress there is a plug-in,https://wordpress.org/plugins/wp-postviews/
I don't know whether there is such a plug-in in Anypic of Parse to count the times?
Of course it will be nice if it can display who has read a post as well.
Thanks
I'm not sure which language you working on.
But anyway you need to create:
Array column in Parse.com
And then just make query to add his name when viewWillAppear
Now you can count the array to get integer number for views and you can display their names from the array.
Two options are;
Add a viewcount column and increment it whenever needed.
Add an actions table which consist all actions within your webpage or app. This way you can store more data(custom analytics) in it like button pressing etc.. When you want to check the viewcount you can just count objects with specific type. For iOS SDK countObjectsInBackgroundWithBlock does this job.

Passing more than 3 items in a reports column link

I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!
Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.
Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.
I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.
These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.

Using Yahoo APIs, how to get list of locations matching certain prefix that have weather data available

I have an app that (among other things) uses Yahoo Weather API to display weather conditions for a location selected by user.
In the configuration dialog where user can enter the location, I'd love to offer autocompletion so that while user is typing location name, list of matching cities is suggested.
I can use YQL to fetch locations matching the prefix, i.e.:
select * from geo.places where text = 'Vie*'
but the problem is that not every location has a weather station associated with it and I'd love to skip these in my autocompletion list.
Using community tables (table called weather.woeid), following query will join previous query with the weather api, returning only locations that do have weather stations:
select location from weather.woeid where w in (select woeid from geo.places where text = 'Vie*')
This almost solves my problem, except for the fact that previous query (which produces same result as weather api call) doesn't return WOEID nor any kind of identifier I can use to directly query the Weather API after configuration. How can I capture the value of join parameter w? I tried something like select w, location ... but that doesn't seem to work.
Is there any other way to get list of locations (incl. WOEID) matching certain prefix that have weather data associated with them?
Afaik it is not possible with YQL to pass through values from the Sub-Select (the inner SELECT statement) to the outer SELECT, which I is what you want to do if I understand you correctly.
Based on your use case I want to propose another solution though:
I assume that the list of locations that have a weather station associated with them is relatively static, meaning this list does not change very often. If that is the case then it would not be very optimal in terms of performance to regenerate that list every time with YQL. Instead I would generate that list offline, store it in a file or MySQL or elsewhere and then just use that static list to answer to the AJAX call of your autocomplete field.
The data in that static list could look something like this:
{
"Vienna" => 72342,
"Hamburg" => 12334,
...
}
Once the user has selected a location and pressed enter, then you can send the YQL query to weather.woeid to look up the current weather based on the WOEID.

Resources