Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Issue with asset's checking in when custom status #33

Open
Joshuaharry120 opened this issue Jul 6, 2020 · 1 comment
Open

Issue with asset's checking in when custom status #33

Joshuaharry120 opened this issue Jul 6, 2020 · 1 comment

Comments

@Joshuaharry120
Copy link

Joshuaharry120 commented Jul 6, 2020

So, following on from setting the status of a device to Damaged - Water Damage.

the script is now treated with the following error.

C:\Program Files (x86)\Scope-IT\Marksman>Marksman.exe
06/07/2020 09:43:16: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: Gigabyte Technology Co., Ltd.
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Desktop
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Model
Instance name: AX370-Gaming K5
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: Partnerize
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel
Instance name: Ready to Deploy
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Location
Instance name: NCL
Already exists in DB

Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Damaged - Water Damage Is an invalid status label.  Use undeployable, deployable, pending, archived, in production, ready to deploy
   at SnipeSharp.Endpoints.Models.StatusLabel.set_Type(String value)
   at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name)
   at Void .ctor(System.String)(Object[] )
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at SnipeSharp.Endpoints.ExtendedManagers.AssetEndpointManager.FindBySerial(String serial)
   at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
   at Marksman.Marksman.Main(String[] args)

C:\Program Files (x86)\Scope-IT\Marksman>pause
Press any key to continue . . .

image

@Joshuaharry120 Joshuaharry120 changed the title Issue with Asse Issue with asset's checking in when custom status Jul 6, 2020
@danielhogg
Copy link
Contributor

Thanks for raising this issue. I'll take a look at it this weekend.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants