MKS Integrity: открыть элемент из командной строки

Я хотел бы открыть элемент в МКС из командной строки, используя номер элемента:

command 123456

и перейти непосредственно к представлению элемента графического интерфейса. Я искал примеры API, но пока не нашел ничего полезного. В расширении я буду использовать его, чтобы сделать ярлык из моего текстового редактора.

Надеюсь, это возможно, есть идеи?


person ragnar    schedule 15.10.2015    source источник


Ответы (2)


im viewissue — это команда cli для «Просмотра элемента». В вашем случае команда должна быть такой:

im viewissue --hostname=%mks_host% --port=%mks_im_port% --user=%mks_user% --gui %item_id%

где %mks_host%, %mks_im_port%, %mks_user% и %item_id% следует заменить правильными значениями.

im viewissue использование команды

Usage: im viewissue options... item id...; options are:
    --asOf=[<date>|label:<label>]  View the item(s) as of a historical date or label
    --height=value  The height in pixels of the windows
    --[no]showAnnotations  Display annotations
    --[no]showAttachmentDetails  Display all attachment attributes
    --[no]showAttachments  Display attachments
    --[no]showBranches  Display branches
    --[no]showChangePackages  Display change packages
    --[no]showDecorators  Display "!" for ambiguous field values
    --[no]showHistory  Display history
    --[no]showHistoryAscending  Display history in chronological order
    --[no]showHistoryWithComputedField  Display history with computed fields
    --[no]showHistoryWithIndirectEdits  Display history with indirect edits (CLI/API only)
    --[no]showLabels  Display labels
    --[no]showLock  Display lock information
    --[no]showRelationships  Display relationships
    --[no]showRichContent  Display rich text field data as rich content
    --[no]showSourceLinkDetails  Display all source link and source trace attributes
    --[no]showSourceTraceDetails  Display all source link and source trace attributes
    --[no]showTestResults  Display test results
    --[no]showTimeEntries  Display time entries
    --[no]showWorkflow  Display workflow
    --[no]showXHTML  Display rich text field data as XHTML
    --[no]substituteParams  Substitute parameters
    --width=value  The width in pixels of the windows
    -x value  The x location in pixels of the window
    -y value  The y location in pixels of the window
    -?  Shows the usage for a command
    --[no]batch  Control batch mode (no user interaction in batch mode)
    --cwd=value  Act as if command executed in specified directory
    -F value  Read the selection from a specified file
    --forceConfirm=[yes|no]  Specify an answer to all confirmation questions
    -g  User interaction should happen via the GUI
    --gui  User interaction should happen via the GUI
    --hostname=value  Hostname of server
    -N  Responds to all confirmations with "no"
    --no  Responds to all confirmations with "no"
    --password=value  Credentials (e.g., password) to login with
    --port=value  TCP/IP port number of server
    --quiet  Control status display
    --selectionFile=value  Read the selection from a specified file
    --settingsUI=[gui|default]  Control UI for command options
    --status=[none|gui|default]  Control status display
    --usage  Shows the usage for a command
    --user=value  Username to login to server with
    -Y  Responds to all confirmations with "yes"
    --yes  Responds to all confirmations with "yes"
person vasilenicusor    schedule 12.11.2015

Хотя стандартной API-команды для перехода к элементу графического веб-интерфейса из интерфейса командной строки не существует, существует стандартный URL-адрес, который можно создать для просмотра любого заданного элемента непосредственно из веб-браузера.

URL-адрес для доступа к элементу напрямую по его идентификатору элемента через веб-браузер будет выглядеть так:

%host_server%:%port%/im/viewissue?selection=%item_id%

куда:

  • %host_server% — это полный URL-адрес сервера, на котором размещено приложение Integrity.
  • %port% — это номер порта приложения Integrity на хост-сервере.
  • %item_id% — целочисленный идентификатор элемента для просмотра.

Пример. Если мое приложение Integrity доступно на сервере https://myhostserver.com через порт 1234 и идентификатор элемента I хотите просмотреть 123456, тогда URL-адрес для построения:

https://myhostserver.com:1234/im/viewissue?selection=123456

Затем эту ссылку можно динамически создать для доступа к любому существующему идентификатору элемента Integrity. Пользователи по-прежнему должны будут пройти аутентификацию в Integrity, прежде чем элемент можно будет просмотреть.

person bRague87    schedule 28.12.2016