Class JiraBugServiceClient
Contains all the JiraBugServiceClient code that is related to the bug creation history of Aruba.
Inherited Members
Namespace: Microsoft.Internal.Studios.Aruba.Jira
Assembly: Aruba.Jira.dll
Syntax
public class JiraBugServiceClient : IBugCreationHistoryServiceClient, IBugServiceClient, IDupeCheckServiceClient
Properties
View SourceAllLabels
Gets the labels of the Jira database available for auto-correct completion.
Declaration
public List<string> AllLabels { get; }
Property Value
Type | Description |
---|---|
List<string> |
ArubaLabel
Gets or sets the value to append to labels when submitting bugs from aruba. Set to null or empty to not append any extra label.
Declaration
public string ArubaLabel { get; set; }
Property Value
Type | Description |
---|---|
string |
JiraClient
Gets the Jira client.
Declaration
public JiraClient JiraClient { get; }
Property Value
Type | Description |
---|---|
JiraClient |
MultiselectControlDelimiter
Gets the multi-select control delimiter for Jira. In Jira, this is a comma.
Declaration
public string MultiselectControlDelimiter { get; }
Property Value
Type | Description |
---|---|
string |
Project
Gets the project found and cached when connecting to the database.
Declaration
public BasicProject Project { get; }
Property Value
Type | Description |
---|---|
BasicProject |
Methods
View SourceAddAttachmentToExistingBugAsync(string, string)
Add an attachment to an existing bug.
Declaration
public Task AddAttachmentToExistingBugAsync(string filePath, string bugID)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The filepath of the attachment to add. |
string | bugID | The ID of the bug. |
Returns
Type | Description |
---|---|
Task | The Task. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If |
CreateBugAsync(BugCreationParams)
Creates a bug and saves it in Jira.
Declaration
public Task<string> CreateBugAsync(BugCreationParams creationParams)
Parameters
Type | Name | Description |
---|---|---|
BugCreationParams | creationParams | The data to create the bug with. |
Returns
Type | Description |
---|---|
Task<string> | The issue key of the newly created bug. |
CreateFromClientAsync(JiraClient, JiraConfig, Action<string>)
Creates the BugServiceClient from the given JiraClient.
Declaration
public static Task<JiraBugServiceClient> CreateFromClientAsync(JiraClient jiraClient, JiraConfig jiraConfig, Action<string> logAction)
Parameters
Type | Name | Description |
---|---|---|
JiraClient | jiraClient | The Jira Client. |
JiraConfig | jiraConfig | The Jira Config for setting up the client. |
Action<string> | logAction | The log Action. |
Returns
Type | Description |
---|---|
Task<JiraBugServiceClient> | The created JiraBugServiceClient |
FindNearbyBugsAsync(IBugPruner, string, string, string, CancellationToken)
Runs a query that checks for bugs nearby to the specified location.
Declaration
public Task<IEnumerable<DupeCheckBugInfo>> FindNearbyBugsAsync(IBugPruner bugPruner, string areaPath, string mapFieldName, string mapName, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IBugPruner | bugPruner | The bug pruner that defines how to remove bugs from the search. |
string | areaPath | The area path that defines which category to search under. |
string | mapFieldName | The field name for the map name data on the bug database. |
string | mapName | The map that the bug resides in. |
CancellationToken | cancellationToken | The cancellation token to cancel the task. |
Returns
Type | Description |
---|---|
Task<IEnumerable<DupeCheckBugInfo>> | A list of all bugs that are nearby. |
FollowBugAsync(string)
Follows a bug given its key.
Declaration
public ValueTask<bool> FollowBugAsync(string bugKey)
Parameters
Type | Name | Description |
---|---|---|
string | bugKey | The bug key. |
Returns
Type | Description |
---|---|
ValueTask<bool> | True if it was followed. |
GetArrayFieldNames()
Gets the names of the fields that are filled with by an array value.
Declaration
public HashSet<string> GetArrayFieldNames()
Returns
Type | Description |
---|---|
HashSet<string> | The HashSet of strings with the field names. |
GetArrayValueFromFieldValue(FieldSchema, object)
Gets the field values from an array type field.
Declaration
public static List<string>? GetArrayValueFromFieldValue(FieldSchema schema, object value)
Parameters
Type | Name | Description |
---|---|---|
FieldSchema | schema | The schema of the field. |
object | value | The values for this field. |
Returns
Type | Description |
---|---|
List<string> | A list of the values as strings for this field. |
GetBrowseUriFromBugKeyAsync(string)
Get the Uri to browse a bug, given the bug key.
Declaration
public ValueTask<Uri?> GetBrowseUriFromBugKeyAsync(string bugKey)
Parameters
Type | Name | Description |
---|---|---|
string | bugKey | The bug key. |
Returns
Type | Description |
---|---|
ValueTask<Uri> | The Uri if found, null otherwise. |
GetBugCreationHistoryForCurrentUserAsync()
Gets the bug creation history for all bugs created by the current user.
Declaration
public Task<IEnumerable<BugCreationHistory>> GetBugCreationHistoryForCurrentUserAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<BugCreationHistory>> | Returns a list of BugCreationHistory. |
Exceptions
Type | Condition |
---|---|
ArubaException | Thrown when any Exception is encountered from querying Jira. |
GetBugCreationHistoryUsingIDAsync(string)
Gets the bug creation history for a single item using the bug ID.
Declaration
public Task<BugCreationHistory> GetBugCreationHistoryUsingIDAsync(string bugID)
Parameters
Type | Name | Description |
---|---|---|
string | bugID | The ID of the bug. |
Returns
Type | Description |
---|---|
Task<BugCreationHistory> | Returns a BugCreationHistory, or null if nothing was found. |
Exceptions
Type | Condition |
---|---|
ArubaException | Thrown when any Exception is encountered from querying Jira. |
GetBugInfoFromKeyAsync(string, CancellationToken)
Gets info about a bug gives its key.
Declaration
public Task<BugInfo?> GetBugInfoFromKeyAsync(string key, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | key | The bug key. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<BugInfo> | The BugInfo task. |
GetBugLinkTypesAsync()
Gets a list of the bug link types available to add to a bug.
Declaration
public Task<List<BugLinkType>> GetBugLinkTypesAsync()
Returns
Type | Description |
---|---|
Task<List<BugLinkType>> | A list of BugLinkType. |
GetBugSubmittedWithinPast5MinutesAsync()
Finds all bugs that have been submitted within the past five minutes.
Declaration
public Task<IEnumerable<DupeCheckBugInfo>> GetBugSubmittedWithinPast5MinutesAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<DupeCheckBugInfo>> | Bugs that have been submitted within the past five minutes. |
GetDefaultTemplateFields()
Gets the default template fields for the bug work item type.
Declaration
public IList<TemplateFieldDefinition> GetDefaultTemplateFields()
Returns
Type | Description |
---|---|
IList<TemplateFieldDefinition> | Returns a list with the fields. |
GetTags()
Gets all the tags available in the database.
Declaration
public List<string> GetTags()
Returns
Type | Description |
---|---|
List<string> | Tags as a list of strings. |
GetValueRestrictedFieldInfo()
Gets the restricted field info.
Declaration
public Dictionary<string, IEnumerable<object>> GetValueRestrictedFieldInfo()
Returns
Type | Description |
---|---|
Dictionary<string, IEnumerable<object>> | A dictionary of the field name and its allowed values. |
MarkFieldAsLabelField(string)
Marks a field to treat it as if it were a labels field. This function should only be called after initialization and will not pull autocomplete info for this field. It is recommended to pull the autocomplete information and add them to AllLabels.
Declaration
public void MarkFieldAsLabelField(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
string | fieldName | The name of the field to treat as a labels field. |
RefreshBugFieldValuesAsync()
Refreshes the available field values from the bug database.
Declaration
public Task RefreshBugFieldValuesAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RunDupeCheckQueryAsync(DuplicateCheckQueryDefinition, IDictionary<string, string>, CancellationToken)
Runs a query that was saved to a bug template for checking for duplicates.
Declaration
public Task<IEnumerable<DupeCheckBugInfo>> RunDupeCheckQueryAsync(DuplicateCheckQueryDefinition queryArgs, IDictionary<string, string> fieldValues, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DuplicateCheckQueryDefinition | queryArgs | The object that contains the arguments for the query. |
IDictionary<string, string> | fieldValues | The values of the fields to be matched. |
CancellationToken | cancellationToken | The cancellation token to cancel the task. |
Returns
Type | Description |
---|---|
Task<IEnumerable<DupeCheckBugInfo>> | A list of all bugs that were returned from the query. |
SetAttachmentInfoIfAvailableAsync(DupeCheckBugInfo, CancellationToken)
Sets the attached files for a given bug.
Declaration
public Task SetAttachmentInfoIfAvailableAsync(DupeCheckBugInfo bug, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DupeCheckBugInfo | bug | The bug to get the attachment info for. This bug's attachment property will be updated. |
CancellationToken | cancellationToken | The cancellation token to cancel the task. |
Returns
Type | Description |
---|---|
Task | An awaitable task. |
ValidateBugCreationParamsAsync(BugCreationParams)
Validate on the client side (as much as possible) if the bug service will be able to create a bug with the given parameters.
Declaration
public Task ValidateBugCreationParamsAsync(BugCreationParams creationParams)
Parameters
Type | Name | Description |
---|---|---|
BugCreationParams | creationParams | The bug creation parameters. |
Returns
Type | Description |
---|---|
Task | The task. |