Comments (7)
You query for the ticket and the data returned includes sys_id.
from servicenow-powershell.
What would the command look like to return the sys_id if I already know the ticket/incident number?
from servicenow-powershell.
You'd do Get-ServiceNowIncident -MatchExact @{number='INC0123456'}
to get the number you want. You could add -Properties sys_id
to only pull back the sys_id if you want (or any specific list of properties). Otherwise it'll pull back default values.
Or for what you described you can take advantage of Update-ServiceNowNumber
by passing the number and table and let it look up the sys_id for you by doing Update-ServiceNowNumber -Number INC0123456 -Table incident -Values @{property='value'}
.
from servicenow-powershell.
so the command Get-ServiceNowIncident -MatchExact @{number='ticket_number'}
works for querying the sys_id for tickets created using your service now module. But when I try to query a ticket_number which was created from the web interface of service now, nothing is returning... Any idea what could be happening? Thank you
from servicenow-powershell.
The PowerShell module interacts with the ServiceNow database just like the web interface does. What you may be running into is the type of ticket you're searching for. Get-ServiceNowIncident
queries the incident
database specifically. That's a ticket with a number that begins with INC
. If you're trying to find a different ticket type you'd need to use the corresponding command. If that command doesn't exist you'd want to use Get-ServiceNowTableEntry
and specify the table name that has your ticket. That's how you'd query for custom ticket tables for example.
from servicenow-powershell.
I'm still trying to query an incident, just not created with the powershell module and instead from the web interface. Is it possible that when I create a ticket from the web interface that the ticket is being stored under a different table other than incident
? I'm not sure what else to try...
from servicenow-powershell.
If you open the ticket in the web you should get a URL such as https://tenant.service-now.com/nav_to.do?uri=%2Fsc_req_item.do%3
and be able to see which table you're looking at. In this example my URL shows me in the sc_req_item
table. Could help you confirm which database you're working in. It should be the incident table from what you described.
from servicenow-powershell.
Related Issues (20)
- Updating Computer Assets in alm_asset Database HOT 2
- Discussions HOT 2
- Filtering on nested property doesn't work HOT 2
- Expanding the CustomVariable HOT 2
- Add-ServiceNowAttachment Error - "Item has already been added. Key in dictionary: 'Content-Type' Key being added: 'Content-Type'" HOT 2
- Attachment Download functionality is gone in New Get-ServiceNowAttachment HOT 4
- Custom Variable 'Reference' Type Value is Incorrect HOT 4
- Updating a Non-Catalog Request HOT 3
- Error with v3.4.3 HOT 3
- Comments still reference deleted function Get-ServiceNowUser HOT 1
- Zero size files cause 'Bad Request' error HOT 1
- How do you add associated CIs to a Change record? HOT 3
- Cannot Close Sctask that requires text in worknotes field not posted and closed task clicked in gui HOT 3
- Allow timeout to be specified for Get-ServiceNowRecord HOT 5
- BasicAuth fails when authentication profiles are active on ServiceNow HOT 2
- Why New-ServiceNowChangeTask does not link the new task to the main change ticket?
- Number of records different when using the filter vs where. HOT 1
- JSON Square Brackets Added to Array's First and Last Objects HOT 4
- Error when using -IncludeCustomVariable: Id must either be a SysId 32 character alphanumeric or Number with prefix and id.
- Updating dmn_demand_task is not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servicenow-powershell.