Module: JIRA::RemoteAPI
- Included in:
- JIRAService
- Defined in:
- lib/jiraSOAP/api.rb,
lib/jiraSOAP/api/users.rb,
lib/jiraSOAP/api/issues.rb,
lib/jiraSOAP/api/avatars.rb,
lib/jiraSOAP/api/filters.rb,
lib/jiraSOAP/api/schemes.rb,
lib/jiraSOAP/api/worklog.rb,
lib/jiraSOAP/api/comments.rb,
lib/jiraSOAP/api/projects.rb,
lib/jiraSOAP/api/versions.rb,
lib/jiraSOAP/api/components.rb,
lib/jiraSOAP/api/attachments.rb,
lib/jiraSOAP/api/server_info.rb,
lib/jiraSOAP/api/project_roles.rb,
lib/jiraSOAP/api/issue_data_types.rb
Overview
Contains the API defined by Atlassian for the JIRA SOAP service.
There are several cases where this API diverges from the one defined by Atlassian; most notably, this API tries to be more idomatically Ruby by using snake case for method names, default values, varargs, etc..
Logging in/out collapse
-
#login(username, password) ⇒ String
(also: #log_in)
The first method to call; other methods will fail until you are logged in.
-
#logout ⇒ Boolean
(also: #log_out)
You only need to call this to make an explicit logout; normally, a session will automatically expire after a set time (configured on the server).
Users collapse
-
#add_user_to_group(group, user) ⇒ Boolean
True if successful.
-
#create_user(username, password, full_name, email) ⇒ JIRA::User?
It seems that creating a user without any permission groups will trigger an exception on some versions of JIRA.
-
#create_user_group(group_name, user = nil) ⇒ JIRA::UserGroup
Create a new user group.
-
#delete_user_group(group_name, swap_group) ⇒ Boolean
True if successful.
-
#delete_user_with_name(username) ⇒ Boolean
True if successful.
- #group_with_name(group_name) ⇒ JIRA::UserGroup
- #remove_user_from_group(group, user) ⇒ Boolean
- #user_with_name(user_name) ⇒ JIRA::User
Issues collapse
-
#available_actions(issue_key) ⇒ Array<JIRA::NamedEntity>
Returns workflow actions available for an issue.
-
#create_issue_with_issue(issue) ⇒ JIRA::Issue
Some fields will be ignored when an issue is created.
- #create_issue_with_issue_and_parent(issue, parent_id) ⇒ JIRA:Issue (also: #create_issue_with_parent)
- #issue_with_id(issue_id) ⇒ JIRA::Issue
- #issue_with_key(issue_key) ⇒ JIRA::Issue
- #issues_from_filter_with_id(id, max_results = 500, offset = 0) ⇒ Array<JIRA::Issue>
-
#issues_from_jql_search(jql_query, max_results = 2000) ⇒ Array<JIRA::Issue>
This method is the equivalent of making an advanced search from the web interface.
-
#progress_workflow_action(issue_key, action_id, *field_values) ⇒ JIRA::Issue
This method acts like #update_issue except that it also updates the status of the issue.
- #resolution_date_for_issue_with_id(issue_id) ⇒ Time
- #resolution_date_for_issue_with_key(issue_key) ⇒ Time
-
#update_issue(issue_key, *field_values) ⇒ JIRA::Issue
This method can update most, but not all, issue fields.
Avatars collapse
-
#delete_project_avatar_with_id(avatar_id) ⇒ Boolean
True if successful.
-
#project_avatar_for_key(project_key) ⇒ JIRA::Avatar
Gets you the default avatar image for a project; if you want all the avatars for a project, use #project_avatars_for_key.
-
#project_avatars_for_key(project_key, include_default_avatars = false) ⇒ Array<JIRA::Avatar>
Gets ALL avatars for a given project with this method; if you just want the project avatar, use #project_avatar_for_key.
-
#set_new_project_avatar_for_project_with_key(project_key, mime_type, base64_image) ⇒ Boolean
Use this method to create a new custom avatar for a project and set it to be current avatar for the project.
-
#set_project_avatar_for_project_with_key(project_key, avatar_id) ⇒ Boolean
Change the project avatar to another existing avatar.
Filters collapse
-
#favourite_filters ⇒ Array<JIRA::Filter>
(also: #favorite_filters)
Retrieves favourite filters for the currently logged in user.
- #issue_count_for_filter_with_id(id) ⇒ Fixnum
Schemes collapse
- #notification_schemes ⇒ Array<JIRA::NotificationScheme>
- #permission_schemes ⇒ Array<JIRA::PermissionScheme>
Worklogs collapse
-
#add_worklog_and_auto_adjust_remaining_estimate(issue_key, worklog) ⇒ Object
Adds a worklog to the given issue.
Comments collapse
-
#add_comment_to_issue_with_key(issue_key, comment) ⇒ Boolean
True if successful.
- #comment_with_id(id) ⇒ JIRA::Comment
- #comments_for_issue_with_key(issue_key) ⇒ Array<JIRA::Comment>
- #permission_to_edit_comment?(comment) ⇒ Boolean
- #update_comment(comment) ⇒ JIRA::Comment
Projects collapse
-
#create_project_with_project(project) ⇒ JIRA::Project
Requires you to set at least a project name, key, and lead.
-
#delete_project_with_key(project_key) ⇒ Boolean
True if successful.
- #project_including_schemes_with_id(project_id) ⇒ JIRA::Project
- #project_with_id(project_id) ⇒ JIRA::Project
-
#project_with_key(project_key) ⇒ JIRA::Project
You need to explicitly ask for schemes in order to get them.
- #projects ⇒ Array<JIRA::Project> (also: #projects_without_schemes)
-
#update_project_with_project(project) ⇒ JIRA::Project
The id of the project is the only field that you cannot update.
Versions collapse
-
#add_version_to_project_with_key(project_key, version) ⇒ JIRA::Version
New versions cannot have the archived bit set and the release date field will ignore the time of day you give it and instead insert the time zone offset as the time of day.
-
#release_state_for_version_for_project(project_name, version) ⇒ Boolean
You can set the release state for a project with this method.
-
#set_archive_state_for_version_for_project(project_key, version_name, state) ⇒ Boolean
The archive state can only be set to true for versions that have not been released.
- #versions_for_project(project_key) ⇒ Array<JIRA::Version>
Components collapse
-
#components_for_project_with_key(project_key) ⇒ Array<JIRA::Component>
Lists a project's components.
Attachments collapse
-
#add_attachments_to_issue_with_key(issue_key, *attachments) ⇒ Boolean
Uploads attachments to an issue using the
addBase64EncodedAttachmentsToIssue
SOAP method. -
#add_base64_encoded_attachments_to_issue_with_key(issue_key, filenames, data) ⇒ Boolean
deprecated
Deprecated.
This will be removed in the next release (either 0.11 or 1.0)
- #attachments_for_issue_with_key(issue_key) ⇒ Array<JIRA::Attachment>
Server Information collapse
- #server_configuration ⇒ JIRA::ServerConfiguration
-
#server_info ⇒ JIRA::ServerInfo
The @build_date attribute is a Time value, but does not include a time.
Project Roles collapse
-
#create_project_role_with_role(project_role) ⇒ JIRA::ProjectRole
The role that was created.
-
#delete_project_role(project_role, confirm = true) ⇒ Boolean
True if successful.
-
#project_role_name_unique?(project_role_name) ⇒ Boolean
Returns true if the name does not exist.
- #project_role_with_id(role_id) ⇒ JIRA::ProjectRole
- #project_roles ⇒ Array<JIRA::ProjectRole>
-
#update_project_role_with_role(project_role) ⇒ JIRA::ProjectRole
The role after the update.
Issue attributes collapse
- #custom_fields ⇒ Array<JIRA::Field>
- #issue_types ⇒ Array<JIRA::IssueType>
- #issue_types_for_project_with_id(project_id) ⇒ Array<JIRA::IssueType>
- #priorities ⇒ Array<JIRA::Priority>
-
#refresh_custom_fields ⇒ Boolean
I have no idea what this method does.
- #resolutions ⇒ Array<JIRA::Resolution>
- #statuses ⇒ Array<JIRA::Status>
- #subtask_issue_types ⇒ Array<JIRA::IssueType>
- #subtask_issue_types_for_project_with_id(project_id) ⇒ Array<JIRA::IssueType>
Instance Method Details
#add_attachments_to_issue_with_key(issue_key, *attachments) ⇒ Boolean
Expect this method to be slow.
Uploads attachments to an issue using the addBase64EncodedAttachmentsToIssue
SOAP method.
The metadata is not automatically refreshed by this method. To get the
updated metadata (e.g., file_size
and content_type
), call
#attachments_for_issue_with_key.
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/jiraSOAP/api/attachments.rb', line 35 def issue_key, * invoke('soap:addBase64EncodedAttachmentsToIssue') { |msg| msg.add 'soap:in0', self.auth_token msg.add 'soap:in1', issue_key msg.add 'soap:in2' do |submsg| .each { || submsg.add 'filenames', .filename } end msg.add 'soap:in3' do |submsg| .each { || submsg.add 'base64EncodedData', [.content].pack('m0') } end } true end |
#add_base64_encoded_attachments_to_issue_with_key(issue_key, filenames, data) ⇒ Boolean
This will be removed in the next release (either 0.11 or 1.0)
(see #add_attachments_to_issue_with_key)
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/jiraSOAP/api/attachments.rb', line 58 def issue_key, filenames, data $stderr.puts <<-EOM RemoteAPI#add_base64_encoded_attachments_to_issue_with_key is deprecated and will be removed in the next release. Please use RemoteAPI#add_attachments_to_issue_with_key instead. EOM invoke('soap:addBase64EncodedAttachmentsToIssue') { |msg| msg.add 'soap:in0', self.auth_token msg.add 'soap:in1', issue_key msg.add 'soap:in2' do |submsg| filenames.each { |filename| submsg.add 'filenames', filename } end msg.add 'soap:in3' do |submsg| data.each { |datum| submsg.add 'base64EncodedData', datum } end } true end |
#add_comment_to_issue_with_key(issue_key, comment) ⇒ Boolean
Returns true if successful.
8 9 10 11 |
# File 'lib/jiraSOAP/api/comments.rb', line 8 def add_comment_to_issue_with_key issue_key, comment jira_call 'addComment', issue_key, comment true end |
#add_user_to_group(group, user) ⇒ Boolean
Returns true if successful.
45 46 47 48 |
# File 'lib/jiraSOAP/api/users.rb', line 45 def add_user_to_group group, user jira_call 'addUserToGroup', group, user true end |
#add_version_to_project_with_key(project_key, version) ⇒ JIRA::Version
New versions cannot have the archived bit set and the release date field will ignore the time of day you give it and instead insert the time zone offset as the time of day.
Remember that the @release_date field is the tentative release date, so its value is independant of the @released flag.
Descriptions do not appear to be included with JIRA::Version objects that SOAP API provides.
25 26 27 |
# File 'lib/jiraSOAP/api/versions.rb', line 25 def add_version_to_project_with_key project_key, version JIRA::Version.new_with_xml jira_call( 'addVersion', project_key, version ) end |
#add_worklog_and_auto_adjust_remaining_estimate(issue_key, worklog) ⇒ Object
Adds a worklog to the given issue.
10 11 12 |
# File 'lib/jiraSOAP/api/worklog.rb', line 10 def add_worklog_and_auto_adjust_remaining_estimate issue_key, worklog JIRA::Worklog.new_with_xml jira_call( 'addWorklogAndAutoAdjustRemainingEstimate', issue_key, worklog ) end |
#attachments_for_issue_with_key(issue_key) ⇒ Array<JIRA::Attachment>
change method name to reflect that you only get metadata
17 18 19 |
# File 'lib/jiraSOAP/api/attachments.rb', line 17 def issue_key array_jira_call JIRA::Attachment, 'getAttachmentsFromIssue', issue_key end |
#available_actions(issue_key) ⇒ Array<JIRA::NamedEntity>
Returns workflow actions available for an issue.
166 167 168 |
# File 'lib/jiraSOAP/api/issues.rb', line 166 def available_actions issue_key array_jira_call JIRA::NamedEntity, 'getAvailableActions', issue_key end |
#comment_with_id(id) ⇒ JIRA::Comment
15 16 17 |
# File 'lib/jiraSOAP/api/comments.rb', line 15 def comment_with_id id JIRA::Comment.new_with_xml jira_call( 'getComment', id ) end |
#comments_for_issue_with_key(issue_key) ⇒ Array<JIRA::Comment>
21 22 23 |
# File 'lib/jiraSOAP/api/comments.rb', line 21 def comments_for_issue_with_key issue_key array_jira_call JIRA::Comment, 'getComments', issue_key end |
#components_for_project_with_key(project_key) ⇒ Array<JIRA::Component>
Lists a project's components
9 10 11 |
# File 'lib/jiraSOAP/api/components.rb', line 9 def components_for_project_with_key project_key array_jira_call JIRA::Component, 'getComponents', project_key end |
#create_issue_with_issue(issue) ⇒ JIRA::Issue
Some fields will be ignored when an issue is created.
- reporter - you cannot override this value at creation
- resolution
- attachments
- votes
- status
- due date - I think this is a bug in jiraSOAP or JIRA
- environment - I think this is a bug in jiraSOAP or JIRA
100 101 102 |
# File 'lib/jiraSOAP/api/issues.rb', line 100 def create_issue_with_issue issue JIRA::Issue.new_with_xml jira_call( 'createIssue', issue ) end |
#create_issue_with_issue_and_parent(issue, parent_id) ⇒ JIRA:Issue Also known as: create_issue_with_parent
107 108 109 |
# File 'lib/jiraSOAP/api/issues.rb', line 107 def create_issue_with_issue_and_parent issue, parent_id JIRA::Issue.new_with_xml jira_call('createIssueWithParent', issue, parent_id) end |
#create_project_role_with_role(project_role) ⇒ JIRA::ProjectRole
Returns the role that was created.
18 19 20 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 18 def create_project_role_with_role project_role JIRA::ProjectRole.new_with_xml jira_call( 'createProjectRole', project_role ) end |
#create_project_with_project(project) ⇒ JIRA::Project
Requires you to set at least a project name, key, and lead. However, it is also a good idea to set other project properties, such as the permission scheme as the default permission scheme can be too restrictive in most cases.
49 50 51 |
# File 'lib/jiraSOAP/api/projects.rb', line 49 def create_project_with_project project JIRA::Project.new_with_xml jira_call( 'createProjectFromObject', project ) end |
#create_user(username, password, full_name, email) ⇒ JIRA::User?
It seems that creating a user without any permission groups will trigger an exception on some versions of JIRA. The irony is that this method provides no way to add groups. The good news though, is that the creation will still happen; but the user will have no permissions.
23 24 25 26 |
# File 'lib/jiraSOAP/api/users.rb', line 23 def create_user username, password, full_name, email fragment = jira_call( 'createUser', username, password, full_name, email ) JIRA::User.new_with_xml fragment end |
#create_user_group(group_name, user = nil) ⇒ JIRA::UserGroup
Create a new user group. You can initialize the group with a user if you wish.
65 66 67 68 |
# File 'lib/jiraSOAP/api/users.rb', line 65 def create_user_group group_name, user = nil frag = jira_call 'createGroup', group_name, user JIRA::UserGroup.new_with_xml frag end |
#custom_fields ⇒ Array<JIRA::Field>
16 17 18 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 16 def custom_fields array_jira_call JIRA::Field, 'getCustomFields' end |
#delete_project_avatar_with_id(avatar_id) ⇒ Boolean
You cannot delete system avatars, and you need project administration permissions to delete other avatars.
Returns true if successful.
32 33 34 35 |
# File 'lib/jiraSOAP/api/avatars.rb', line 32 def delete_project_avatar_with_id avatar_id jira_call 'deleteProjectAvatar', avatar_id true end |
#delete_project_role(project_role, confirm = true) ⇒ Boolean
The confirm argument appears to do nothing (at least on JIRA 4.0)
Returns true if successful.
39 40 41 42 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 39 def delete_project_role project_role, confirm = true jira_call 'deleteProjectRole', project_role, confirm true end |
#delete_project_with_key(project_key) ⇒ Boolean
Returns true if successful.
65 66 67 68 |
# File 'lib/jiraSOAP/api/projects.rb', line 65 def delete_project_with_key project_key jira_call 'deleteProject', project_key true end |
#delete_user_group(group_name, swap_group) ⇒ Boolean
Find out the semantics of swap_group
Returns true if successful.
76 77 78 79 |
# File 'lib/jiraSOAP/api/users.rb', line 76 def delete_user_group group_name, swap_group jira_call 'deleteGroup', group_name, swap_group true end |
#delete_user_with_name(username) ⇒ Boolean
Returns true if successful.
30 31 32 33 |
# File 'lib/jiraSOAP/api/users.rb', line 30 def delete_user_with_name username jira_call 'deleteUser', username true end |
#favourite_filters ⇒ Array<JIRA::Filter> Also known as: favorite_filters
Retrieves favourite filters for the currently logged in user.
9 10 11 |
# File 'lib/jiraSOAP/api/filters.rb', line 9 def favourite_filters array_jira_call JIRA::Filter, 'getFavouriteFilters' end |
#group_with_name(group_name) ⇒ JIRA::UserGroup
37 38 39 40 |
# File 'lib/jiraSOAP/api/users.rb', line 37 def group_with_name group_name frag = jira_call 'getGroup', group_name JIRA::UserGroup.new_with_xml frag end |
#issue_count_for_filter_with_id(id) ⇒ Fixnum
16 17 18 |
# File 'lib/jiraSOAP/api/filters.rb', line 16 def issue_count_for_filter_with_id id jira_call( 'getIssueCountForFilter', id ).to_i end |
#issue_types ⇒ Array<JIRA::IssueType>
21 22 23 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 21 def issue_types array_jira_call JIRA::IssueType, 'getIssueTypes' end |
#issue_types_for_project_with_id(project_id) ⇒ Array<JIRA::IssueType>
27 28 29 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 27 def issue_types_for_project_with_id project_id array_jira_call JIRA::IssueType, 'getIssueTypesForProject', project_id end |
#issue_with_id(issue_id) ⇒ JIRA::Issue
120 121 122 |
# File 'lib/jiraSOAP/api/issues.rb', line 120 def issue_with_id issue_id JIRA::Issue.new_with_xml jira_call( 'getIssueById', issue_id ) end |
#issue_with_key(issue_key) ⇒ JIRA::Issue
114 115 116 |
# File 'lib/jiraSOAP/api/issues.rb', line 114 def issue_with_key issue_key JIRA::Issue.new_with_xml jira_call( 'getIssue', issue_key ) end |
#issues_from_filter_with_id(id, max_results = 500, offset = 0) ⇒ Array<JIRA::Issue>
128 129 130 |
# File 'lib/jiraSOAP/api/issues.rb', line 128 def issues_from_filter_with_id id, max_results = 500, offset = 0 array_jira_call JIRA::Issue, 'getIssuesFromFilterWithLimit', id, offset, max_results end |
#issues_from_jql_search(jql_query, max_results = 2000) ⇒ Array<JIRA::Issue>
During my own testing, I found that HTTP requests could timeout for really large requests (~2500 results) if you are not on the same network. So I set a more reasonable upper limit; feel free to override it, but be aware of the potential issues.
This method is the equivalent of making an advanced search from the web interface.
The Issue structure does not include any comments or attachments.
20 21 22 |
# File 'lib/jiraSOAP/api/issues.rb', line 20 def issues_from_jql_search jql_query, max_results = 2000 array_jira_call JIRA::Issue, 'getIssuesFromJqlSearch', jql_query, max_results end |
#login(username, password) ⇒ String Also known as: log_in
The first method to call; other methods will fail until you are logged in.
17 18 19 20 21 |
# File 'lib/jiraSOAP/api.rb', line 17 def login username, password response = soap_call 'login', username, password @user = username @auth_token = response.first.content end |
#logout ⇒ Boolean Also known as: log_out
You only need to call this to make an explicit logout; normally, a session will automatically expire after a set time (configured on the server).
28 29 30 31 32 33 |
# File 'lib/jiraSOAP/api.rb', line 28 def logout jira_call( 'logout' ).to_boolean.tap do |_| @user = nil @auth_token = nil end end |
#notification_schemes ⇒ Array<JIRA::NotificationScheme>
6 7 8 |
# File 'lib/jiraSOAP/api/schemes.rb', line 6 def notification_schemes array_jira_call JIRA::NotificationScheme, 'getNotificationSchemes' end |
#permission_schemes ⇒ Array<JIRA::PermissionScheme>
11 12 13 |
# File 'lib/jiraSOAP/api/schemes.rb', line 11 def array_jira_call JIRA::PermissionScheme, 'getPermissionSchemes' end |
#permission_to_edit_comment?(comment) ⇒ Boolean
32 33 34 |
# File 'lib/jiraSOAP/api/comments.rb', line 32 def comment jira_call( 'hasPermissionToEditComment', comment ).to_boolean end |
#priorities ⇒ Array<JIRA::Priority>
6 7 8 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 6 def priorities array_jira_call JIRA::Priority, 'getPriorities' end |
#progress_workflow_action(issue_key, action_id, *field_values) ⇒ JIRA::Issue
This method acts like #update_issue except that it also updates the status of the issue.
The action_id
parameter comes from the id
of an available action.
Normally you will use this method in conjunction with
#available_actions to decide which action to take.
156 157 158 159 |
# File 'lib/jiraSOAP/api/issues.rb', line 156 def progress_workflow_action issue_key, action_id, *field_values JIRA::Issue.new_with_xml jira_call('progressWorkflowAction', issue_key, action_id, field_values) end |
#project_avatar_for_key(project_key) ⇒ JIRA::Avatar
Gets you the default avatar image for a project; if you want all the avatars for a project, use #project_avatars_for_key.
11 12 13 |
# File 'lib/jiraSOAP/api/avatars.rb', line 11 def project_avatar_for_key project_key JIRA::Avatar.new_with_xml jira_call('getProjectAvatar', project_key) end |
#project_avatars_for_key(project_key, include_default_avatars = false) ⇒ Array<JIRA::Avatar>
Gets ALL avatars for a given project with this method; if you just want the project avatar, use #project_avatar_for_key.
22 23 24 |
# File 'lib/jiraSOAP/api/avatars.rb', line 22 def project_avatars_for_key project_key, include_default_avatars = false array_jira_call JIRA::Avatar, 'getProjectAvatars', project_key, include_default_avatars end |
#project_including_schemes_with_id(project_id) ⇒ JIRA::Project
Parse the permission scheme
This method does not yet include the permission scheme.
28 29 30 |
# File 'lib/jiraSOAP/api/projects.rb', line 28 def project_including_schemes_with_id project_id JIRA::Project.new_with_xml jira_call( 'getProjectWithSchemesById', project_id ) end |
#project_role_name_unique?(project_role_name) ⇒ Boolean
JIRA 4.0 and 4.2 returns an exception if the name already exists
Returns true if the name does not exist.
29 30 31 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 29 def project_role_name_unique? project_role_name jira_call( 'isProjectRoleNameUnique', project_role_name ).to_boolean end |
#project_role_with_id(role_id) ⇒ JIRA::ProjectRole
12 13 14 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 12 def project_role_with_id role_id JIRA::ProjectRole.new_with_xml jira_call( 'getProjectRole', role_id ) end |
#project_roles ⇒ Array<JIRA::ProjectRole>
6 7 8 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 6 def project_roles array_jira_call JIRA::ProjectRole, 'getProjectRoles' end |
#project_with_id(project_id) ⇒ JIRA::Project
18 19 20 |
# File 'lib/jiraSOAP/api/projects.rb', line 18 def project_with_id project_id JIRA::Project.new_with_xml jira_call( 'getProjectById', project_id ) end |
#project_with_key(project_key) ⇒ JIRA::Project
You need to explicitly ask for schemes in order to get them. By default, most project fetching methods purposely leave out all the scheme information as permission schemes can be very large.
12 13 14 |
# File 'lib/jiraSOAP/api/projects.rb', line 12 def project_with_key project_key JIRA::Project.new_with_xml jira_call( 'getProjectByKey', project_key ) end |
#projects ⇒ Array<JIRA::Project> Also known as: projects_without_schemes
This will not fill in Scheme data for the projects.
36 37 38 |
# File 'lib/jiraSOAP/api/projects.rb', line 36 def projects array_jira_call JIRA::Project, 'getProjectsNoSchemes' end |
#refresh_custom_fields ⇒ Boolean
find out what this method does
I have no idea what this method does.
53 54 55 56 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 53 def refresh_custom_fields jira_call 'refreshCustomFields' true end |
#release_state_for_version_for_project(project_name, version) ⇒ Boolean
You can set the release state for a project with this method.
48 49 50 51 |
# File 'lib/jiraSOAP/api/versions.rb', line 48 def release_state_for_version_for_project project_name, version jira_call 'releaseVersion', project_name, version true end |
#remove_user_from_group(group, user) ⇒ Boolean
53 54 55 56 |
# File 'lib/jiraSOAP/api/users.rb', line 53 def remove_user_from_group group, user jira_call 'removeUserFromGroup', group, user true end |
#resolution_date_for_issue_with_id(issue_id) ⇒ Time
134 135 136 |
# File 'lib/jiraSOAP/api/issues.rb', line 134 def resolution_date_for_issue_with_id issue_id jira_call( 'getResolutionDateById', issue_id ).to_iso_date end |
#resolution_date_for_issue_with_key(issue_key) ⇒ Time
140 141 142 |
# File 'lib/jiraSOAP/api/issues.rb', line 140 def resolution_date_for_issue_with_key issue_key jira_call( 'getResolutionDateByKey', issue_key ).to_iso_date end |
#resolutions ⇒ Array<JIRA::Resolution>
11 12 13 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 11 def resolutions array_jira_call JIRA::Resolution, 'getResolutions' end |
#server_configuration ⇒ JIRA::ServerConfiguration
14 15 16 |
# File 'lib/jiraSOAP/api/server_info.rb', line 14 def server_configuration JIRA::ServerConfiguration.new_with_xml jira_call( 'getConfiguration' ) end |
#server_info ⇒ JIRA::ServerInfo
The @build_date attribute is a Time value, but does not include a time.
9 10 11 |
# File 'lib/jiraSOAP/api/server_info.rb', line 9 def server_info JIRA::ServerInfo.new_with_xml jira_call( 'getServerInfo' ) end |
#set_archive_state_for_version_for_project(project_key, version_name, state) ⇒ Boolean
The archive state can only be set to true for versions that have not been released. However, this is not reflected by the return value of this method.
37 38 39 40 |
# File 'lib/jiraSOAP/api/versions.rb', line 37 def set_archive_state_for_version_for_project project_key, version_name, state jira_call 'archiveVersion', project_key, version_name, state true end |
#set_new_project_avatar_for_project_with_key(project_key, mime_type, base64_image) ⇒ Boolean
You need project administration permissions to edit an avatar.
Use this method to create a new custom avatar for a project and set it to be current avatar for the project.
The image, provided as base64 encoded data, should be a 48x48 pixel square. If the image is larger, the top left 48 pixels are taken, if it is smaller then it will be upscaled to 48 pixels. The small version of the avatar image (16 pixels) is generated automatically.
If you want to switch a project avatar to an avatar that already exists on the system then use #set_project_avatar_for_project_with_key instead.
70 71 72 73 |
# File 'lib/jiraSOAP/api/avatars.rb', line 70 def set_new_project_avatar_for_project_with_key project_key, mime_type, base64_image jira_call 'setNewProjectAvatar', project_key, mime_type, base64_image true end |
#set_project_avatar_for_project_with_key(project_key, avatar_id) ⇒ Boolean
You need project administration permissions to edit an avatar.
JIRA does not care if the avatar_id is valid.
Change the project avatar to another existing avatar. If you want to upload a new avatar and set it to be the new project avatar use #set_new_project_avatar_for_project_with_key instead.
46 47 48 49 |
# File 'lib/jiraSOAP/api/avatars.rb', line 46 def set_project_avatar_for_project_with_key project_key, avatar_id jira_call 'setProjectAvatar', project_key, avatar_id true end |
#statuses ⇒ Array<JIRA::Status>
32 33 34 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 32 def statuses array_jira_call JIRA::Status, 'getStatuses' end |
#subtask_issue_types ⇒ Array<JIRA::IssueType>
37 38 39 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 37 def subtask_issue_types array_jira_call JIRA::IssueType, 'getSubTaskIssueTypes' end |
#subtask_issue_types_for_project_with_id(project_id) ⇒ Array<JIRA::IssueType>
43 44 45 |
# File 'lib/jiraSOAP/api/issue_data_types.rb', line 43 def subtask_issue_types_for_project_with_id project_id array_jira_call JIRA::IssueType, 'getSubTaskIssueTypesForProject', project_id end |
#update_comment(comment) ⇒ JIRA::Comment
27 28 29 |
# File 'lib/jiraSOAP/api/comments.rb', line 27 def update_comment comment JIRA::Comment.new_with_xml jira_call( 'editComment', comment ) end |
#update_issue(issue_key, *field_values) ⇒ JIRA::Issue
This method can update most, but not all, issue fields. Some limitations are because of how the API is designed, and some are because I have not yet implemented the ability to update fields made of custom objects (things in the JIRA module).
Fields known to not update via this method:
- status - use #progress_workflow_action
- attachments - use #add_base64_encoded_attachments_to_issue_with_key
Though FieldValue objects have an id field, they do not expect
to be given id values. You must use the camel cased name of the field you
wish to update, such as 'fixVersions'
to update the fix_versions
for
an issue.
However, there is at least one exception to the rule; when you wish to
update the affected versions for an issue, you should use 'versions'
instead of 'affectsVersions'
. You need to be careful about these
cases as it has been reported that JIRA will silently fail to update
fields it does not know about.
Updating nested fields can be tricky, see the example on cascading select field's to see how it would be done.
A final note, some fields only should be passed the id in order to update them, as shown in the version updating example.
83 84 85 |
# File 'lib/jiraSOAP/api/issues.rb', line 83 def update_issue issue_key, *field_values JIRA::Issue.new_with_xml jira_call('updateIssue', issue_key, field_values) end |
#update_project_role_with_role(project_role) ⇒ JIRA::ProjectRole
JIRA 4.0 will not update project roles, it will instead throw an exception telling you that the project role already exists
Returns the role after the update.
50 51 52 |
# File 'lib/jiraSOAP/api/project_roles.rb', line 50 def update_project_role_with_role project_role JIRA::ProjectRole.new_with_xml jira_call( 'updateProjectRole', project_role ) end |
#update_project_with_project(project) ⇒ JIRA::Project
The id of the project is the only field that you cannot update. Or, at least the only field I know that you cannot update.
59 60 61 |
# File 'lib/jiraSOAP/api/projects.rb', line 59 def update_project_with_project project JIRA::Project.new_with_xml jira_call( 'updateProject', project ) end |
#user_with_name(user_name) ⇒ JIRA::User
7 8 9 |
# File 'lib/jiraSOAP/api/users.rb', line 7 def user_with_name user_name JIRA::User.new_with_xml jira_call( 'getUser', user_name ) end |
#versions_for_project(project_key) ⇒ Array<JIRA::Version>
7 8 9 |
# File 'lib/jiraSOAP/api/versions.rb', line 7 def versions_for_project project_key array_jira_call JIRA::Version, 'getVersions', project_key end |