Documentation
¶
Index ¶
- Constants
- Variables
- func IsUrl(str string) bool
- type Actors
- type ActorsAPIData
- type AvatarUrls
- type BodyActors
- type Client
- func (client *Client) AddActorsToProjectRole(ctx context.Context, projectId, roleId string, body BodyActors) (ActorsAPIData, error)
- func (client *Client) AddProjectRoleActorsToRole(ctx context.Context, roleId string, body BodyActors) (ActorsAPIData, error)
- func (client *Client) AddUserToGroup(ctx context.Context, groupName, userName string) (int, error)
- func (c *Client) CreateIssue(ctx context.Context, projectKey string, summary string, opts ...FieldOption) (*jira.Issue, error)
- func (client *Client) DeleteProjectRoleActorsFromRole(ctx context.Context, roleId, actor, actorName string) (int, error)
- func (client *Client) GetGroupLabelRoles(ctx context.Context, groupName string) ([]Labels, error)
- func (client *Client) GetGroupMembers(ctx context.Context, groupName string) ([]GroupUser, error)
- func (client *Client) GetGroupRole(ctx context.Context) ([]Group, error)
- func (c *Client) GetIssue(ctx context.Context, issueID string) (*jira.Issue, error)
- func (c *Client) GetIssueTypeFields(ctx context.Context, projectKey, issueTypeId string, ...) ([]*jira.MetaDataFields, error)
- func (c *Client) GetIssueTypesForProject(ctx context.Context, projectKey string, opts *jira.GetQueryIssueTypeOptions) ([]*jira.MetaIssueType, error)
- func (c *Client) GetProject(ctx context.Context, projectID string) (*jira.Project, error)
- func (client *Client) GetProjectRoleDetails(ctx context.Context, urlApi string) (RolesAPIData, error)
- func (client *Client) GetProjectRoles(ctx context.Context, projectId string) (map[string]string, error)
- func (client *Client) GetRole(ctx context.Context, roleId string) (RolesAPIData, error)
- func (client *Client) GetUser(ctx context.Context, userName string) (jira.User, error)
- func (client *Client) GetUserName(ctx context.Context, userId string) (string, error)
- func (client *Client) ListAllGroups(ctx context.Context) ([]Group, error)
- func (client *Client) ListAllPermissionScheme(ctx context.Context) (PermissionSchemes, error)
- func (client *Client) ListAllPermissions(ctx context.Context) ([]Permission, error)
- func (client *Client) ListAllRoles(ctx context.Context) ([]RolesAPIData, error)
- func (client *Client) ListAllUsers(ctx context.Context) ([]jira.User, error)
- func (c *Client) ListProjects(ctx context.Context) ([]*jira.Project, error)
- func (c *Client) ListStatuses(ctx context.Context) ([]*jira.Status, error)
- func (c *Client) ListStatusesForProject(ctx context.Context, projectID string) ([]*jira.Status, error)
- func (client *Client) Myself(ctx context.Context) error
- func (client *Client) RemoveActorsFromProjectRole(ctx context.Context, projectId, roleId, actor, actorName string) (int, error)
- func (client *Client) RemoveUserFromGroup(ctx context.Context, groupName, userName string) (int, error)
- type FieldOption
- type Group
- type GroupMembersAPIData
- type GroupRolesAPIData
- type GroupUser
- type GroupsAPIData
- type Holder
- type JiraError
- type Labels
- type Permission
- type PermissionSchemes
- type PermissionSchemesAPIData
- type Permissions
- type PermissionsAPIData
- type ProjectRole
- type Query
- type RolesAPIData
- type UsersAPIData
Constants ¶
const (
NF = -1
)
Variables ¶
var (
ErrUserNotFound = fmt.Errorf("user not found")
)
Functions ¶
Types ¶
type ActorsAPIData ¶
type AvatarUrls ¶
type BodyActors ¶
type Client ¶
type Client struct { BaseURL string // contains filtered or unexported fields }
func (*Client) AddActorsToProjectRole ¶
func (client *Client) AddActorsToProjectRole(ctx context.Context, projectId, roleId string, body BodyActors) (ActorsAPIData, error)
AddActorsToProjectRole Adds an actor (user or group) to a project role in the Jira DC. For user actors, their usernames should be used. https://docs.atlassian.com/software/jira/docs/api/REST/9.14.0/#api/2/project/{projectIdOrKey}/role-addActorUsers
func (*Client) AddProjectRoleActorsToRole ¶
func (client *Client) AddProjectRoleActorsToRole(ctx context.Context, roleId string, body BodyActors) (ActorsAPIData, error)
AddProjectRoleActorsToRole Adds default actors to the given role. The request data should contain a list of usernames or a list of groups to add. https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/role-addProjectRoleActorsToRole
func (*Client) AddUserToGroup ¶
AddUserToGroup Adds given user to a group in the Jira DC. Returns the current state of the group. https://docs.atlassian.com/software/jira/docs/api/REST/9.14.0/#api/2/group-addUserToGroup
func (*Client) CreateIssue ¶
func (*Client) DeleteProjectRoleActorsFromRole ¶
func (client *Client) DeleteProjectRoleActorsFromRole(ctx context.Context, roleId, actor, actorName string) (int, error)
DeleteProjectRoleActorsFromRole Removes default actor from the given role. https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/role-deleteProjectRoleActorsFromRole
func (*Client) GetGroupLabelRoles ¶
GetGroupLabelRoles Return group label roles.
func (*Client) GetGroupMembers ¶
GetGroupMembers Returns all members that are present in a group.
func (*Client) GetGroupRole ¶
GetGroupRole Return all group roles.
func (*Client) GetIssueTypeFields ¶
func (c *Client) GetIssueTypeFields(ctx context.Context, projectKey, issueTypeId string, opts *jira.GetQueryIssueTypeOptions) ([]*jira.MetaDataFields, error)
func (*Client) GetIssueTypesForProject ¶
func (c *Client) GetIssueTypesForProject(ctx context.Context, projectKey string, opts *jira.GetQueryIssueTypeOptions) ([]*jira.MetaIssueType, error)
func (*Client) GetProject ¶
func (*Client) GetProjectRoleDetails ¶
func (client *Client) GetProjectRoleDetails(ctx context.Context, urlApi string) (RolesAPIData, error)
GetProjectRoleDetails Returns all role details that are present in specific project.
func (*Client) GetProjectRoles ¶
func (client *Client) GetProjectRoles(ctx context.Context, projectId string) (map[string]string, error)
GetProjectRoles Returns all roles that are present in specific project.
func (*Client) GetUserName ¶
GetUserName Returns user name.
func (*Client) ListAllGroups ¶
ListAllGroups Returns all groups that are present in the Jira instance.
func (*Client) ListAllPermissionScheme ¶
func (client *Client) ListAllPermissionScheme(ctx context.Context) (PermissionSchemes, error)
ListAllPermissionScheme Returns all permission schemes that are present in the Jira DC.
func (*Client) ListAllPermissions ¶
func (client *Client) ListAllPermissions(ctx context.Context) ([]Permission, error)
ListAllPermissions Returns all permissions that are present in the Jira instance https://docs.atlassian.com/software/jira/docs/api/REST/9.14.0/#api/2-getAllPermissions
func (*Client) ListAllRoles ¶
func (client *Client) ListAllRoles(ctx context.Context) ([]RolesAPIData, error)
ListAllRoles Returns all roles that are present in the Jira instance.
func (*Client) ListAllUsers ¶
ListAllUsers Returns all users that are present in the Jira instance.
func (*Client) ListProjects ¶
func (*Client) ListStatuses ¶
func (*Client) ListStatusesForProject ¶
func (*Client) RemoveActorsFromProjectRole ¶
func (client *Client) RemoveActorsFromProjectRole(ctx context.Context, projectId, roleId, actor, actorName string) (int, error)
RemoveActorsProjectRole Deletes actors (users or groups) from a project role in the Jira DC. https://docs.atlassian.com/software/jira/docs/api/REST/9.14.0/#api/2/project/{projectIdOrKey}/role-deleteActor
func (*Client) RemoveUserFromGroup ¶
func (client *Client) RemoveUserFromGroup(ctx context.Context, groupName, userName string) (int, error)
RemoveUserFromGroup Removes given user from a group in the Jira DC. https://docs.atlassian.com/software/jira/docs/api/REST/9.14.0/#api/2/group-removeUserFromGroup
type FieldOption ¶
func WithComponents ¶
func WithComponents(componentIDs ...string) FieldOption
func WithCustomField ¶
func WithCustomField(id string, value interface{}) FieldOption
func WithDescription ¶
func WithDescription(description string) FieldOption
func WithLabels ¶
func WithLabels(labels ...string) FieldOption
func WithStatus ¶
func WithStatus(statusId string) FieldOption
func WithType ¶
func WithType(id string) FieldOption
type GroupMembersAPIData ¶
type GroupRolesAPIData ¶
type GroupUser ¶
type GroupUser struct { Self string `json:"self,omitempty"` Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` AvatarUrls AvatarUrls `json:"avatarUrls,omitempty"` DisplayName string `json:"displayName,omitempty"` Active bool `json:"active,omitempty"` TimeZone string `json:"timeZone,omitempty"` }
type GroupsAPIData ¶
type Holder ¶
type Holder struct { Type string `json:"type,omitempty"` Parameter string `json:"parameter,omitempty"` ProjectRole ProjectRole `json:"projectRole,omitempty"` }
type JiraError ¶
type JiraError struct { ErrorMessage string `json:"error"` ErrorDescription string `json:"error_description"` ErrorCode int `json:"errorCode,omitempty"` ErrorSummary string `json:"errorSummary,omitempty" toml:"error_description"` ErrorLink string `json:"errorLink,omitempty"` ErrorId string `json:"errorId,omitempty"` ErrorCauses []map[string]interface{} `json:"errorCauses,omitempty"` }
type Permission ¶
type PermissionSchemes ¶
type PermissionSchemesAPIData ¶
type PermissionSchemesAPIData struct {
PermissionSchemes []PermissionSchemes `json:"permissionSchemes,omitempty"`
}
type Permissions ¶
type PermissionsAPIData ¶
type PermissionsAPIData struct { Permissions map[string]any `json:"Permissions,omitempty"` Roles []Permission `json:"Roles,omitempty"` }
type ProjectRole ¶
type RolesAPIData ¶
type UsersAPIData ¶
type UsersAPIData struct { Self string `json:"self,omitempty"` Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` AvatarUrls AvatarUrls `json:"avatarUrls,omitempty"` DisplayName string `json:"displayName,omitempty"` Active bool `json:"active,omitempty"` Deleted bool `json:"deleted,omitempty"` TimeZone string `json:"timeZone,omitempty"` Locale string `json:"locale,omitempty"` }