[ 
https://issues.apache.org/jira/browse/FINERACT-2417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047239#comment-18047239
 ] 

Satvik Mishra commented on FINERACT-2417:
-----------------------------------------

Hi, I tried to recreate the issue. 
 * I ran the fineract-provider locally using the graddle bootRun.
 * I then hit a POST request using Postman to get a clientId on the URL  
{{"https://localhost:8443/fineract-provider/api/v1/templates"; and the body}}
{{{}}
{{  "name": "Bug Reproduction Template",}}
{{  "entity": 0,}}
{{  "type": 0,}}
{{  "text": "Hello \{{client.displayName}}",}}
{{  "mappers": []}}
{{}}}
{{}}
 * Then I got the clientId as 1 in response. 

 * Next I hitted a GET request on 
"https://localhost:8443/fineract-provider/api/v1/templates/1?clientId=1"; and I 
did not got a 404 error rather I got a 200 OK. 
 * But the response body did not contain the clients actual name, it ignored 
the client id and gave this response 

{
"name":"Bug Reproduction Template",
"entity":"client",
"type":"Document",
"text":"Hello \{{client.displayName}}",
"mappers":[],
"id":1,
"isNew":false
}
 

I figured out that the issue is in retrieveOne method in 
TemplatesApiResource.java. The method is strictly designed to return the 
template entity definition. It lacks the logic to check for execution 
parameters (like {{{}clientId{}}}, {{{}loanId{}}}) and delegate to the merge 
service.

I think I can work on the issue and fix it.

> Template Reports not working
> ----------------------------
>
>                 Key: FINERACT-2417
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2417
>             Project: Apache Fineract
>          Issue Type: Improvement
>    Affects Versions: 1.13.0
>            Reporter: Bharath Gowda
>            Priority: Major
>             Fix For: 1.15.0
>
>         Attachments: Screenshot 2025-12-12 at 11.34.33 AM.png, 
> image-2025-12-11-19-38-36-915.png, image-2025-12-12-11-39-40-963.png, 
> image-2025-12-12-11-39-49-125.png
>
>
> To reproduce the issue
>  
> 1. Create a sample template for the client or loan entity.
>      under Admin->Templates->create template
> 2. Execute the report from the client/loan screen respectively
>      Under the client screen->menu->more->client screen reports,
>      select the created report and generate the report.
>  
> System is throwing a 404 OK error
> Expected Fix
>  # If the API is used in UI to generate the template report exists or wrong 
> API
>  ## If wrong API data, could anyone help with the correct API and body for 
> running the template reports?
>  # Is this a backend bug?
>  ## If yes, please help in fixing the same with the below example API and 
> response.
>  
>  
> Full error example
> API
> [https://URL/fineract-provider/api/v1/templates/1?clientId=10|https://url/fineract-provider/api/v1/templates/1?clientId=10]
> body: "{}"
> "accept": "application/json, text/plain, */*",
> "accept-language": "en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7",
>  "authorization": "Basic Y2hhcmxlczpDaGFybGVzQDEyMyM=",
> "fineract-platform-tenantid": "default",
>  
> Error Response
>  
> {"developerMessage":"The requested resource is not 
> available.","httpStatusCode":"404","defaultUserMessage":"The requested 
> resource is not 
> available.","userMessageGlobalisationCode":"error.msg.resource.not.found","errors":[\{"defaultUserMessage":"Template
>  with url 
> https://tomcat/fineract-provider/api/clients/10?tenantIdentifier=default not 
> allowed","parameterName":"id","developerMessage":"Template with url 
> https://tomcat/fineract-provider/api/clients/10?tenantIdentifier=default not 
> allowed","userMessageGlobalisationCode":"error.msg.template.url.forbidden","args":[]}]}
>  
>  
> Expected result
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to