MyPureCloud / terraform-provider-genesyscloud

Terraform Provider Genesyscloud
MIT License
35 stars 79 forks source link

Expose additional IDs in quality forms #1066

Closed louisdesilva closed 2 months ago

louisdesilva commented 4 months ago

I will appreciate if you could expose questionGroups, questions and answerOptions ID to genesyscloud provider in terraform.

From the API explorer, the data is there but not available within terraform provider.

Thank you.

charliecon commented 3 months ago

Hi @louisdesilva

Could you send URL of the endpoint on the API Explorer that has these fields, and also let me know what terraform resource specifically is missing them? I can see that these fields already exist inside "genesyscloud_quality_forms_evaluation"

Thanks, Charlie

louisdesilva commented 3 months ago

Hi Charlie,

As per https://developer.genesys.cloud/devapps/api-explorer#put-api-v2-quality-surveys-scorable, in the "answer" section, you can see that it only is accepting "questionGroupId", "questionId" and "answerId".

Where the "genesyscloud_quality_forms_evaluation" does not provides those Ids.

Regards, Louis

General


From: Charlie Conneely @.> Sent: Wednesday, June 5, 2024 6:55 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Hi @louisdesilvahttps://github.com/louisdesilva

Could you send URL of the endpoint on the API Explorer that has these fields, and also let me know what terraform resource specifically is missing them? I can see that these fields already exist inside "genesyscloud_quality_forms_evaluation"

Thanks, Charlie

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2149252487, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRJCDOLGBJNJRM2M44LZF3G7ZAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGI2TENBYG4. You are receiving this because you were mentioned.

charliecon commented 3 months ago

Just so I understand better, does PUT /api/v2/quality/surveys/scorable update an evaluation form? You can see here on our Terraform registry the endpoints that the evaluation forms resource uses.

If there is a new field in the request body for POST /api/v2/quality/forms/evaluations that is not in the resource, it will be a simple change for us to make. If we will need to implement a new endpoint into the resource, it will take more time.

louisdesilva commented 3 months ago

Yes, I am working on Terraform that deployed the form and data actions to update the form at the end of the survey using a workflow.

To work around now, I ran terraform to deploy the survey form, then I query the formID via the API to obtain the questionsID and answersID, I then put them into a varset and ran terraform again to deploy the data-action with the IDs.

Thank you Charlie.

General


From: Charlie Conneely @.> Sent: Wednesday, June 5, 2024 8:55 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Just so I understand better, does PUT /api/v2/quality/surveys/scorablehttps://developer.genesys.cloud/devapps/api-explorer#put-api-v2-quality-surveys-scorable update an evaluation form? You can see herehttps://registry.terraform.io/providers/MyPureCloud/genesyscloud/latest/docs/resources/quality_forms_evaluation#nestedblock--question_groups--questions--answer_options on our Terraform registry the endpoints that the evaluation forms resource uses.

If there is a new field in the request body for POST /api/v2/quality/forms/evaluationshttps://developer.genesys.cloud/devapps/api-explorer#post-api-v2-quality-forms-evaluations that is not in the resource, it will be a simple change for us to make. If we will need to implement a new endpoint into the resource, it will take more time.

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2149499214, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRIQGLJZNMA7SP4X2CLZF3VBHAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGQ4TSMRRGQ. You are receiving this because you were mentioned.Message ID: @.***>

charliecon commented 3 months ago

I understand now. You're saying it would be better if you could set the ID of your questions and answers yourself when you create the form, so that you can reference them elsewhere in your terraform config?

louisdesilva commented 3 months ago

Yes 🙂 Like now, I can reference callflowID in another flow etc.

General


From: Charlie Conneely @.> Sent: Wednesday, June 5, 2024 9:24 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

I understand now. You're saying it would be better if you could set the ID of your questions and answers yourself when you create the form, so that you can reference them elsewhere in your terraform config?

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2149587935, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRPRWU74VR5JQIGCXWTZF3YOJAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGU4DOOJTGU. You are receiving this because you were mentioned.Message ID: @.***>

charliecon commented 3 months ago

We will create a ticket for this and get a developer working on it as soon as possible. The resource will be updated within the next 2/3 weeks.

If we need any more info from you, or if you have any questions, we can use this thread 🙂

Thanks, Louis!

(Tracking with DEVTOOLING-625)

louisdesilva commented 3 months ago

Thanks Charlie. Awesome 🙂

General


From: Charlie Conneely @.> Sent: Wednesday, June 5, 2024 9:35 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

We will create a ticket for this and get a developer working on it as soon as possible. The resource will be updated within the next 2/3 weeks.

If we need any more info from you, or if you have any questions, we can use this thread 🙂

Thanks, Louis!

(Tracking with DEVTOOLING-625)

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2149609901, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRLT7J4BVBPMJT2HUMDZF3ZYVAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGYYDSOJQGE. You are receiving this because you were mentioned.Message ID: @.***>

charliecon commented 3 months ago

Hi @louisdesilva

I tried adding the ID fields to the items in questions and answerOptions in POST /api/v2/quality/forms/evaluations. The problem I'm facing is that the API generated a random GUID for these IDs regardless of whether I provide a value or not.

Have you seen this behaviour, or are you able to set your own GUID for these objects?

I may have to speak to the team that owns the API to see if they can help out with this issue.

-Charlie

louisdesilva commented 3 months ago

Hi Charlie,

From what I have seen, the id in the survey form (questionid and answerid) changes each time you make a change and re-publish the form. and once the form is published, the questionid and answerid GUID remains the same regardless how many times you use it.

Regards, Louis

General


From: Charlie Conneely @.> Sent: Wednesday, June 12, 2024 6:28 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Hi @louisdesilvahttps://github.com/louisdesilva

I tried adding the ID fields to the items in questions and answerOptions in POST /api/v2/quality/forms/evaluationshttps://developer.genesys.cloud/devapps/api-explorer#post-api-v2-quality-forms-evaluations. The problem I'm facing is that the API generated a random GUID for these IDs regardless of whether I provide a value or not.

Have you seen this behaviour, or are you able to set your own GUID for these objects?

I may have to speak to the team that owns the API to see if they can help out with this issue.

-Charlie

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2162414127, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRM2RKOGE2T3BZOQFULZHABEHAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGQYTIMJSG4. You are receiving this because you were mentioned.

charliecon commented 3 months ago

If the API decides what the question/answerOption ID is, it won't make a difference if I add the id field to the resource. I'm talking with the team that owns the API to confirm that this is the case. I'll keep you posted.

charliecon commented 2 months ago

Hi @louisdesilva

Quick update: I added the ID fields to the schemas you mentioned above. They cannot be set by the user as the API will always generate them even if you provide a value, so they will be strictly read-only. Although it would be more convenient to set the IDs yourself and store the value in a local variable, having them as read-only fields means you can reference them in your Terraform config like this:

output "question_group_id" {
  value = genesyscloud_quality_forms_evaluation.example.question_groups.0.id
}

output "question_id_1" {
  value  = genesyscloud_quality_forms_evaluation.example.question_groups.0.questions.0.id
}

output "question_id_2" {
  value  = genesyscloud_quality_forms_evaluation.example.question_groups.0.questions.1.id
}

All going well, you should see these changes released tomorrow on v1.43.0

Best regards, Charlie

louisdesilva commented 2 months ago

Thank you Charlie.

General


From: Charlie Conneely @.> Sent: Thursday, July 18, 2024 9:09 PM To: MyPureCloud/terraform-provider-genesyscloud @.> Cc: De Silva, Louis @.>; Mention @.> Subject: Re: [MyPureCloud/terraform-provider-genesyscloud] Expose additional IDs in quality forms (Issue #1066)

[External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Hi @louisdesilvahttps://github.com/louisdesilva

Quick update: I added the ID fields to the schemas you mentioned above. They cannot be set by the user as the API will always generate them even if you provide a value, so they will be strictly read-only. Although it would be more convenient to set the IDs yourself and store the value in a local variable, having them as read-only fields means you can reference them in your Terraform config like this:

output "question_group_id" { value = genesyscloud_quality_forms_evaluation.example.question_groups.0.id }

output "question_id_1" { value = genesyscloud_quality_forms_evaluation.example.question_groups.0.questions.0.id }

output "question_id_2" { value = genesyscloud_quality_forms_evaluation.example.question_groups.0.questions.1.id }

All going well, you should see these changes released tomorrow on v1.43.0

Best regards, Charlie

— Reply to this email directly, view it on GitHubhttps://github.com/MyPureCloud/terraform-provider-genesyscloud/issues/1066#issuecomment-2236236565, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYHXLRPGP3YXYVAJRTPFYE3ZM6O7TAVCNFSM6AAAAABIVUMTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZWGIZTMNJWGU. You are receiving this because you were mentioned.Message ID: @.***>