Project

General

Profile

Actions

Defect #22628

closed

Create issue with custom fields with ruby API

Added by Marcin Garski about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Hey!
I'm trying to create an issus in ruby script with one custom_field. I've created custom field (down drop list with 5 values) with web interface. I tried to do this according to wiki: Rest_api_with_ruby, but I think this wiki page is out of date. I searched for older tickets, found that 'custom_field_values' isn't used anymore, the new approach is to do this with array 'custom_fields' and by update operation (get issue by id and set values in custom_fields array).
The example given in wiki throws error:

ActiveResource::BadRequest: Failed.  Response code = 400.  Response message = Bad Reques

The best solution would be to assign the right value while creating issue (one save operation), I don't want to create it in first step, and then set the right value of custom field with update method (two save operations).

Is it possible? Please, correct the wiki page if it's deprecated.

Thx for help.
gary

Actions

Also available in: Atom PDF