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 = null)
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 = null)
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 = null)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 = null)
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 |
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 = null)
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 = null)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 = null)
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 = null)
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, IFinalClause, Int32, 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<SearchResult<Issue>> SearchAsync(this IIssueDomain jiraClient, IFinalClause jql, int maxResults = 20, IEnumerable<string> fields = null, CancellationToken cancellationToken = null)
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.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<SearchResult<Issue>> | SearchResult |
SearchAsync(IIssueDomain, String, Int32, 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<SearchResult<Issue>> SearchAsync(this IIssueDomain jiraClient, string jql, int maxResults = 20, IEnumerable<string> fields = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
IIssueDomain | jiraClient | IIssueDomain to bind the extension method to |
System.String | jql | Jira Query Language, like SQL, for the search |
System.Int32 | maxResults | Maximum number of results returned, default is 20 |
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<SearchResult<Issue>> | SearchResult |
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 = null)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 = null)
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 |