https://github.com/kirqe/yandex_tracker
https://github.com/kirqe/yandex_tracker
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kirqe/yandex_tracker
- Owner: kirqe
- License: mit
- Created: 2024-11-14T10:35:50.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-15T09:54:54.000Z (5 months ago)
- Last Synced: 2025-03-26T21:06:45.885Z (2 months ago)
- Language: Ruby
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# YandexTracker
Ruby API client for [YandexTracker](https://yandex.cloud/en-ru/docs/tracker/about-api) with partially implemented resources for essential needs
## Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add yandex_tracker
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install yandex_tracker
## Configure
```ruby
YandexTracker.configure do |config|
config.client_id = "abc"
config.client_secret = "def"
config.org_id = "123" # or cloud_org_id
endYandexTracker::Auth.exchange_code(code)
# or
YandexTracker.configure do |config|
config.access_token = "xyz"
config.org_id = "123" # or cloud_org_id
end
```## Usage
```ruby
client = YandexTracker::Client.newclient.users.myself
client.workflows.list
client.resolutions.listmyqueue = client.queues.create(
key: "MYQUEUE",
name: "MYQUEUE",
lead: "me", # should have correct name
defaultType: "task",
defaultPriority: "normal",
issueTypesConfig: {
issueType: "task",
workflow: "developmentPresetWorkflow",
resolutions: ["wontFix"]
}
) #myqueue.issues #
issue = myqueue.issues.create(summary: "zxc")
comment = issue.comments.create(text: "ok")issue.attachments.create(File.open("Screenshot.png"))
unattached_file = client.attachments.create(File.open("Screenshot.png"))
comment.create(text: "More details", attachmentIds: [temp_attachment.id])issue.transitions.list
issue.transition('wont_fix', comment: 'wae')
issue.transition('reopen', comment: 'no')
issue.transition('close', resolution: 'wontFix')client.issues.list
client.issues(queue: "MYQUEUE").list
attachments = client.attachments(issue: "MYQUEUE-1").list
attachments.first.downloadclient.comments(issue: "MYQUEUE-1").create(text: "hello")
issue = client.issues.search({
filter: { queue: "TEST", status: "open"}},
expand: "attachments"
).firstissue.createdBy
issue.createdBy.expandissue.attachments
issue.dataclient.issues.import({
queue: "TEST",
summary: "Test",
createdAt: "2017-08-29T12:34:41.740+0000",
createdBy: "username",
...
})client.categories.list
client.categories.create(
name: { en: "My Category", ru: "Моя Категория" },
order: 1
)client.fields.create(
name: { en: "My Field", ru: "Моe поле" },
id: "myglobalfield",
type: "ru.yandex.startrek.core.fields.StringFieldType",
category: "0000000000000003********"
)myqueue.local_fields.list
myqueue.local_fields.create(
name: { en: "My Field", ru: "Моe поле" },
id: "myglobalfield",
category: "0000000000000003********",
type: "ru.yandex.startrek.core.fields.StringFieldType"
)
```## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).