Comments (9)
@BristleBeard - No time frame I'd want to quote. If you'd like to play with the functions I've set them up for download.
Any feedback you have would be appreciated if you use the files.
from servicenow-powershell.
Hey there, started looking at your project and thought I would try and contribute.
You could provide update functionality by combining add and remove. You still need the separate add/remove functions, just adds to ease of use. Perhaps provide a -allowclobber or similar parameter to deal with multiple files that already exist with the same name when someone tries to update (you'd need to allow removal by name as well as sys_id).
I'm just getting into the SN API and probably just my lack of knowledge, but not sure I understand the difference between add and save. In fact, looking at the rest api, I don't see a save option. Is it a 2 step process, add and then save?
from servicenow-powershell.
We could do an Update command that simply removes and adds. I'm afraid to play with anything by name though. I ran across a ticket in my org this week that had 10+ files with the same name attached. No idea why. One would hope anyone doing an update would only have one of each name, but I'd hate to blow away someone's data by trying to work off of name when the back end relies upon sys_id and the accuracy that provides.
If you look here the top two GET
calls get metadata. The third GET
call gets the binary file - or the bits necessary to create the attachment. The Save
function uses that third option to save the file locally (download).
I hope you like the project and can contribute. Thanks for the reply.
from servicenow-powershell.
That was one of the use cases I was thinking of. Someone mistakenly attaches multiple files with the same name and wants to remove them all. We could ensure we use confirmations and alert them to how many they will be removing before we do so. I understand your hesitation to provide this. I definitely get that sys_id is unique, but people will recognize a file by name, not sys_id so thought this might be better.
Another option might be to provide an All parameter to the remove function and of course provide the same confirmation.
Thanks for the link, makes sense now. I thought we were adding the attachment to the ticket, kind of like queuing it up, and then saving. Maybe instead of Get-ServiceNowAttachment call it Get-ServiceNowAttachmentDetail and instead of Save-ServiceNowAttachment calll it Get-ServiceNowAttachment with an optional file path parameter? This would give someone the ability to either get the binary response and perform additional actions or save it to a file.
from servicenow-powershell.
I chatted with someone in the PowerShell Slack today who suggested Read-ServiceNowAttachent to get the details and Get-ServiceNowAttachment to perform the download. That coincides with the logic written in Get vs Read, but I hesitate to take that route. The Read verb is not often used and doing Read | Get
strikes me as less clear than the other two options.
Right this minute I'm leaning towards Get-ServiceNowAttachmentDetail and Get-ServiceNowAttachment. Going with the idea that Save is for a state, not for a download.
from servicenow-powershell.
I like the link, great info, thanks.
from servicenow-powershell.
Do you have a timeframe that you may roll this feature out? I'm actually researching how to add an attachment now, so it'd be nice to not reinvent the wheel! :)
from servicenow-powershell.
PR #78 has been submitted for attachment management. Would appreciate a review of the changes if anyone is so inclined. There are changes not included in the download I linked above for BristleBeard.
from servicenow-powershell.
Published to prod in #79
from servicenow-powershell.
Related Issues (20)
- Is there a way to find/edit "Test Items" within ServiceNow? HOT 2
- Add Support For Change Management APIs HOT 13
- 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
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.