Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

Request generation with numerical property name

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I'm trying to create a connector to create an issue in Redmine. But i'm facing the following problem.

 

The issue in Redmine has custom fields which can be defined in the API request using the property "custom_field_values" by passing the list of custom fields id as property name and the corresponding value to affect.

 

Format expected by Redmine for the "custom_field_values"

 

"custom_field_values": {
 "3": "value of field 3",
 "4": "value of field 4"
}

 

 

But, when the request body is generated by Power Automate, the "custom_field_values" property contains an array with a number of values corresponding to the max of the custom field ids and all values are set with 'null' excepted for each indices corresponding to each  custom field ids which have the correct value to affect. 

 

Format generated for the "custom_field_values" 

 

"custom_field_values": [
 null,
 null,
 null,
 "Value of field 3",
 "value of field 4"
],

 

 

This behaviour seems to be due to the fact that the property name of each custom field is numerical.

What should I correct in the connector in order to obtain the request body expected by Redmine ?

 

Here is the corresponding swagger code:

 

swagger: '2.0'
info: {title: Redmine_connector, description: '', version: '1.0'}
host: redmine_url
basePath: /
schemes: [https]
consumes: []
produces: []
paths:
 /issues.json:
 post:
 responses:
 default:
 description: default
 schema: {}
 summary: Redmine connector
 description: Create an issue in Redmine
 operationId: Redmine_connector
 parameters:
 - name: body
 in: body
 required: false
 schema:
 type: object
 properties:
 issue:
 type: object
 properties:
 is_private: {type: string, description: is_private}
 project_id: {type: string, description: project_id}
 tracker_id: {type: string, description: tracker_id}
 subject: {type: string, description: subject}
 description: {type: string, description: description}
 status_id: {type: string, description: status_id}
 priority_id: {type: string, description: priority_id}
 assigned_to_id: {type: string, description: assigned_to_id}
 custom_field_values:
 type: object
 properties:
 '3': {type: string, description: '3'}
 '4': {type: string, description: '4'}
 description: custom_field_values
 notes: {type: string, description: notes}
 description: issue
definitions: {}
parameters: {}
responses: {}
securityDefinitions:
 API_key: {type: apiKey, in: header, name: X-Redmine-API-Key}
security:
- API_key: []
tags: []

 

 

Example of full request body expected by Redmine

 

{
 "issue": {
 "is_private": "0",
 "project_id": "myProject",
 "tracker_id": "41",
 "subject": "Test Redmine issue creation",
 "description": "test decription",
 "status_id": "26",
 "priority_id": "2",
 "assigned_to_id": "1234",
 "custom_field_values": 	{
 		"3": "Client_entity"
 	},
 "notes": "test3"
 }
}

 

 

Thank you.

Categories:
  • murshed Profile Picture
    murshed on at
    Re: Request generation with numerical property name

    "But, when the request body is generated by Power Automate, the "custom_field_values" property contains an array with a number of values corresponding to the max of the custom field ids"

     

    Can you please explain little more what you mean by "max of custom field ids"? If this is an object as you defined in the code you posted above there should not be a max. I am assuming you are constructing it as an array in some way and passing on the value. You are expecting that value to be a JSON object since it is defined as such in the schema, but the array was returned. Please correct me if I am wrong. You will need to use compose operation to construct a JSON.

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard

Featured topics