On Sat, Dec 12, 2009 at 11:39 PM, Andrey Belous via RT
<bug-JIRA-Client@rt.cpan.org> wrote:
Show quoted text> Queue: JIRA-Client
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=52367 >
>
> Hi, Gustavo
> We just switched to JIRA and it is different from what we used before. This is maybe why I am not familiar with how jira is working.
> My original problem was with custom field. In order to add to custom filed I need to get original value first.
>
> my $issue = $jira->getIssue('TST-1');
> my @custom_fields = $jira->get_issue_custom_field_values($issue,"customfield_10007");
>
> Append string
> And run update issue or progress_workflow_action_safely depends on other variables
Ah. Custom fields are a little more involved because of the way they
are represented inside a RemoteIssue object. Supposing you want to
append a line to a custom field called 'How to Repeat', you could do
this:
my $issue = $jira->getIssue('TST-1');
my ($how_to_repeat) = $jira->get_issue_custom_field_values($issue,
'How to Repeat');
$issue = $jira->update_issue($issue, {custom_fields => {'How to
Repeat' => "$how_to_repeat\nNew line.\n"}});
Note that you can refer to it by name ('How to Repeat'), if you
connect to JIRA with a user with administrative privileges. Otherwise,
you need to use the field's id explicitly.
Gustavo.