Class IssueExtensions
This holds all the issue related extensions methods
Inheritance
Inherited Members
Namespace: Dapplo.Jira
Assembly: Dapplo.Jira.dll
Syntax
public static class IssueExtensions
Methods
| Improve this Doc View SourceAddCommentAsync(IIssueDomain, String, String, String, CancellationToken)
Add comment to the specified issue See: https://docs.atlassian.com/jira/REST/latest/#d2e1139
Declaration
public static Task<Comment> AddCommentAsync(this IIssueDomain jiraClient, string issueKey, string body, string visibility = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | key for the issue |
System.String | body | the body of the comment |
System.String | visibility | optional visibility role |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Comment> | Comment |
AssignAsync(IIssueDomain, String, User, CancellationToken)
Assign an issue to a user
Declaration
public static Task AssignAsync(this IIssueDomain jiraClient, string issueKey, User user, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | Key for the issue to assign |
User | user | User to assign to, use User.Nobody to remove the assignee or User.Default to automaticly assign |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
CreateAsync<TFields>(IIssueDomain, IssueWithFields<TFields>, CancellationToken)
Create an issue
Declaration
public static Task<IssueWithFields<TFields>> CreateAsync<TFields>(this IIssueDomain jiraClient, IssueWithFields<TFields> issue, CancellationToken cancellationToken = default(CancellationToken))
where TFields : IssueFields
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
IssueWithFields<TFields> | issue | the issue to create |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IssueWithFields<TFields>> | Issue |
Type Parameters
Name | Description |
---|---|
TFields | The type of the issue fields |
DeleteAsync(IIssueDomain, String, Boolean, CancellationToken)
Delete an issue
Declaration
public static Task DeleteAsync(this IIssueDomain jiraClient, string issueKey, bool deleteSubtasks = false, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | the key of the issue to delete |
System.Boolean | deleteSubtasks | true or false (default) indicating that any subtasks should also be deleted. If the issue has no subtasks this parameter is ignored. If the issue has subtasks and this parameter is missing or false, then the issue will not be deleted and an error will be returned |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GetAssignableUsersAsync(IIssueDomain, String, String, Nullable<Int32>, Nullable<Int32>, CancellationToken)
Retrieve the users who this issue can be assigned to
Declaration
public static Task<IEnumerable<User>> GetAssignableUsersAsync(this IIssueDomain jiraClient, string issueKey, string userpattern = null, int? startAt = default(int? ), int? maxResults = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IProjectDomain |
System.String | issueKey | string with the key of the issue |
System.String | userpattern | optional string with a pattern to match the user to |
System.Nullable<System.Int32> | startAt | optional int with the start, used for paging |
System.Nullable<System.Int32> | maxResults | optional int with the maximum number of results, default is 50 |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<User>> | IEnumerable with User |
GetAsync(IIssueDomain, String, CancellationToken)
Get issue information See: https://docs.atlassian.com/jira/REST/latest/#d2e4539
Declaration
public static Task<Issue> GetAsync(this IIssueDomain jiraClient, string issueKey, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | the issue key |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Issue> | Issue |
GetAsync<TIssue, TFields>(IIssueDomain, String, CancellationToken)
Get issue information See: https://docs.atlassian.com/jira/REST/latest/#d2e4539
Declaration
public static Task<TIssue> GetAsync<TIssue, TFields>(this IIssueDomain jiraClient, string issueKey, CancellationToken cancellationToken = default(CancellationToken))
where TIssue : IssueWithFields<TFields> where TFields : IssueFields
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | the issue key |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TIssue> | Issue |
Type Parameters
Name | Description |
---|---|
TIssue | |
TFields |
GetIssueTypesAsync(IIssueDomain, CancellationToken)
Get a list of all possible issue types
Declaration
public static Task<IList<IssueType>> GetIssueTypesAsync(this IIssueDomain jiraClient, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<IssueType>> | List with IssueType elements |
GetPossibleTransitionsAsync(IIssueDomain, String, CancellationToken)
Get possible transitions for the specified issue See: https://docs.atlassian.com/jira/REST/latest/#d2e1289
Declaration
public static Task<IList<Transition>> GetPossibleTransitionsAsync(this IIssueDomain jiraClient, string issueKey, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | the issue key |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<Transition>> | List of Transition |
SearchAsync(IIssueDomain, JqlIssueSearch, Page, IEnumerable<String>, CancellationToken)
Search for issues, with a JQL (e.g. from a filter) See: https://docs.atlassian.com/jira/REST/latest/#d2e2713
Declaration
public static Task<SearchIssuesResult<Issue, JqlIssueSearch>> SearchAsync(this IIssueDomain jiraClient, JqlIssueSearch search, Page page = null, IEnumerable<string> fields = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
JqlIssueSearch | search | Search information, with Jira Query Language, like SQL, for the search |
Page | page | Page with paging information, overwriting the page info in the search. |
System.Collections.Generic.IEnumerable<System.String> | fields | Jira fields to include, if null the defaults from the JiraConfig.SearchFields are taken |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SearchIssuesResult<Issue, JqlIssueSearch>> | SearchIssuesResult |
SearchAsync(IIssueDomain, JqlIssueSearch, CancellationToken)
Search for issues, with a JQL (e.g. from a filter) See: https://docs.atlassian.com/jira/REST/latest/#d2e2713
Declaration
public static Task<SearchIssuesResult<Issue, JqlIssueSearch>> SearchAsync(this IIssueDomain jiraClient, JqlIssueSearch search, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
JqlIssueSearch | search | The search arguments |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SearchIssuesResult<Issue, JqlIssueSearch>> | SearchIssuesResult |
SearchAsync(IIssueDomain, IFinalClause, Int32, Int32, IEnumerable<String>, IEnumerable<String>, CancellationToken)
Search for issues, with a JQL (e.g. from a filter) See: https://docs.atlassian.com/jira/REST/latest/#d2e2713
Declaration
public static Task<SearchIssuesResult<Issue, JqlIssueSearch>> SearchAsync(this IIssueDomain jiraClient, IFinalClause jql, int maxResults = 20, int startAt = 0, IEnumerable<string> fields = null, IEnumerable<string> expand = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
IFinalClause | jql | Jira Query Language, like SQL, for the search. Use Where builder |
System.Int32 | maxResults | Maximum number of results returned, default is 20 |
System.Int32 | startAt | Start of the results to return, used for paging. Default is 0 |
System.Collections.Generic.IEnumerable<System.String> | fields | Jira fields to include, if null the defaults from the JiraConfig.SearchFields are taken |
System.Collections.Generic.IEnumerable<System.String> | expand | Additional fields to includes in the results, if null the defaults from the JiraConfig.ExpandSearch are taken |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SearchIssuesResult<Issue, JqlIssueSearch>> | SearchResults |
SearchAsync(IIssueDomain, String, Page, IEnumerable<String>, IEnumerable<String>, CancellationToken)
Search for issues, with a JQL (e.g. from a filter) See: https://docs.atlassian.com/jira/REST/latest/#d2e2713
Declaration
public static Task<SearchIssuesResult<Issue, JqlIssueSearch>> SearchAsync(this IIssueDomain jiraClient, string jql, Page page = null, IEnumerable<string> fields = null, IEnumerable<string> expand = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | jql | Jira Query Language, like SQL, for the search |
Page | page | Page with paging information, default this starts at the beginning with a maxResults of 20 |
System.Collections.Generic.IEnumerable<System.String> | fields | Jira fields to include, if null the defaults from the JiraConfig.SearchFields are taken |
System.Collections.Generic.IEnumerable<System.String> | expand | Additional fields to includes in the results, if null the defaults from the JiraConfig.ExpandSearch are taken |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SearchIssuesResult<Issue, JqlIssueSearch>> | SearchIssuesResult |
UpdateAsync<TFields>(IIssueDomain, IssueWithFields<TFields>, Boolean, Boolean, Boolean, CancellationToken)
Update an issue
Declaration
public static Task UpdateAsync<TFields>(this IIssueDomain jiraClient, IssueWithFields<TFields> issue, bool notifyUsers = true, bool overrideScreenSecurity = false, bool overrideEditableFlag = false, CancellationToken cancellationToken = default(CancellationToken))
where TFields : IssueFields
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
IssueWithFields<TFields> | issue | the issue to update |
System.Boolean | notifyUsers | send the email with notification that the issue was updated to users that watch it. Admin or project admin permissions are required to disable the notification. default = true |
System.Boolean | overrideScreenSecurity | allows to update fields that are not on the screen. Only connect add-on users with admin scope permission are allowed to use this flag. default = false |
System.Boolean | overrideEditableFlag | Updates the issue even if the issue is not editable due to being in a status with jira.issue.editable set to false or missing. Only connect add-on users with admin scope permission are allowed to use this flag. default = false |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | TIssue |
Type Parameters
Name | Description |
---|---|
TFields | The type of the issue |
UpdateCommentAsync(IIssueDomain, String, Comment, CancellationToken)
Update comment See: https://docs.atlassian.com/jira/REST/latest/#d2e1139
Declaration
public static Task<Comment> UpdateCommentAsync(this IIssueDomain jiraClient, string issueKey, Comment comment, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | issueKey | jira key to which the comment belongs |
Comment | comment | Comment to update |
System.Threading.CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Comment> | Comment |