Project

General

Profile

Actions

Bug #38527

closed

"POST /api/job_templates/:id/clone" fails to clone a job-template

Added by Gaurav Talreja 10 days ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-

Description

Description of problem:

How reproducible:
Always

Is this issue a regression from an earlier version:
No

Steps to Reproduce:
1. Setup latest Foreman and fetch the ID of any job-template to clone, for example "Ansible Roles - Ansible Default"

2. # curl -X POST -k -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Basic <token>' -i 'https://example.redhat.com/api/job_templates/<jobtemplate-id>/clone' --data '{"name": "Cloned Template Name"}'
.
.

{
"error": {"id":<jobtemplate-id>,"errors":

{"base":["This template is locked. Please clone it to a new template to customize."]}
,"full_messages":["This template is locked. Please clone it to a new template to customize."]}

Actual behavior:
JobTemplate clone fails with "This template is locked. Please clone it to a new template to customize"

Expected behavior:
JobTemplate clone works without any errors

Business Impact / Additional info:
Also, tried passing data like below in curl command and it also fails with same error,

--data '{"job_template": {"name": "Cloned Template Name"}}'

Actions

Also available in: Atom PDF