Table of Contents

Method GetTickets

Namespace
Skyline.DataMiner.Net.Ticketing
Assembly
SLNetTypes.dll

GetTickets(params Ticket[])

Retrieves the tickets that match the specified filters.

[Obsolete("Please use the new GetTickets(IEnumerable<TicketLink> links, Messages.SLDataGateway.FilterElement<Ticket> filter, bool CacheOnly)", true)]
public IEnumerable<Ticket> GetTickets(params Ticket[] filters)

Parameters

filters Ticket[]

The filter to use when searching the tickets.

Returns

IEnumerable<Ticket>

The tickets that match the specified filters.

GetTickets(params FilterElement<Ticket>[])

Retrieves the tickets that match the specified filters.

[Obsolete("Please use the new GetTickets(IEnumerable<TicketLink> links, Messages.SLDataGateway.FilterElement<Ticket> filter, bool CacheOnly)", true)]
public IEnumerable<Ticket> GetTickets(params FilterElement<Ticket>[] filters)

Parameters

filters FilterElement<Ticket>[]

The filter to use when searching the tickets.

Returns

IEnumerable<Ticket>

The tickets that match the specified filters.

Retrieves the tickets that match the specified filters and links.

public IEnumerable<Ticket> GetTickets(IEnumerable<TicketLink> links = null, FilterElement<Ticket> filter = null, bool CacheOnly = false)

Parameters

links IEnumerable<TicketLink>

The links to be used when searching the tickets.

filter FilterElement<Ticket>

The filter to use when searching the tickets.

CacheOnly bool

Indicates whether to only check the cache (true) or also the DB (false).

Returns

IEnumerable<Ticket>

The tickets that match the specified filter and links.

Retrieving tickets by ticket field:

public Ticket RetrieveTicketByField()
{
	var outputTickets = helper.GetTickets(filter: ReflectiveExposer.DictField<Ticket, object>("CustomTicketFields", "User").Equal("Jane"));
	if (outputTickets.Count() != 1)
		return null;
return outputTickets.First();

}

Retrieving tickets by state:

public Ticket RetrieveTicketByState()
{
	var outputTickets = helper.GetTickets(filter: ReflectiveExposer.DictField<Ticket, object>("CustomTicketFields", "State").Equal(0));
//Alternatively: 
var alternative = helper.GetTickets(filter: ReflectiveExposer.DictField<Ticket, object>("CustomTicketFields", "State").Equal(new GenericEnumEntry<int>()
  {
	  Name = "Created",
	  Value = 0
  }));

if (outputTickets.Count() != 1)
	return null;

return outputTickets.First();

}

Retrieving tickets by link:

public Ticket RetrieveTicketByLink()
{
	var outputTickets = helper.GetTickets(new TicketLink[] { TicketLink.Create(new Skyline.DataMiner.Net.ElementID(123, 456)) });
if (outputTickets.Count() != 1)
	return null;

return outputTickets.First();

}

Retrieving tickets by ticket field resolver:

public Ticket[] RetrieveTicketByResolverID(TicketFieldResolver resolver)
{
	var outputTickets = helper.GetTickets(filter: TicketingExposers.ResolverID.Equal(resolver.ID));
return outputTickets.ToArray();

}