QueueSystem.GetMyJobCount method

Office 2013 and later

Gets the number of queue jobs submitted by the current user.

Namespace:  WebSvcQueueSystem
Assembly:  ProjectServerServices (in ProjectServerServices.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/GetMyJobCount", RequestNamespace = "http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
	ResponseNamespace = "http://schemas.microsoft.com/office/project/server/webservices/QueueSystem/", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public int GetMyJobCount(
	QueueMsgType[] messageTypes,
	JobState[] JobCompletionState,
	DateTime fromDate,
	DateTime toDate,
	int maxRows
)

Parameters

messageTypes
Type: []

Array of QueueMsgType enumeration values. If a null reference (Nothing in Visual Basic), count all types.

JobCompletionState
Type: []

JobState enumeration value. If a null reference (Nothing in Visual Basic), count all states.

fromDate
Type: System.DateTime

Earliest date and time of queue jobs.

toDate
Type: System.DateTime

Latest date and time of queue jobs.

maxRows
Type: System.Int32

Maximum number of jobs to count. If zero (0), count all.

Return value

Type: System.Int32
Count of number of queue jobs within the specified dates, of the specified types and states, submitted by the current user.

Project Server Permissions

Permission

Description

LogOn

Allows the user to log on to Project Server. Global permission.

The following code fragment counts the total number of jobs of all types and states the current user submitted to the queue during the current day.

private static QueueSystemWS.QueueSystem queueSystem =
    new QueueSystemWS.QueueSystem();
. . .
int myJobCount = queueSystem.GetMyJobCount(null, null, DateTime.Today, DateTime.Now, 0);
MessageBox.Show("Number of my queue jobs: " + myJobCount.ToString(), "Job Count");
Show: