Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

account id render problem

john peter September 21, 2023

i have account Id and put user field but render content is displayed like this below and i got tunnel value is like this format { accountId: '63a9ad1715d69a40aa185fe5' }

Trace ID: 0000000000000000b92121b848cf32e7 There was an error invoking the function - Unexpected child type: object. Valid children are @Forge/ui components, function components, and strings. Error occurred in Text: in CustomField in CustomField in View

Error: Unexpected child type: object. Valid children are @forge/ui components, function components, and strings.
Error occurred in Text:
	in CustomField
	in CustomField

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 21, 2023

Hi @john peter -- Welcome to the Atlassian Community!

I recommend posting a question like this one in the developer community:

https://community.developer.atlassian.com/

And when you do make that post, consider providing more context for your question, as it is possible you already have the displayName attribute and that is not visible without describing more of your scenario/application code.

Kind regards,
Bill

john peter September 21, 2023
import ForgeUI, {useState, useProductContext, CustomField, Text} from "@forge/ui";
import api, { route } from '@forge/api';


export async function setCommentId({fieldKey, issueId, lastAuthor}) {
const url = route`/rest/api/2/app/field/${fieldKey}/value`;
var bodyData = `{
"updates": [
{
"issueIds": [ ${issueId} ],
"value":{"accountId":"${lastAuthor}"}
}
]
}`;
const response = await api.asApp().requestJira(url, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
}


export const commentTtl = async (issueKey) => {
const response = await api.asApp().requestJira(route`/rest/api/3/issue/${issueKey}/comment`);
const data = await response.json();
return data.comments;
};

export const View = () => {
const context = useProductContext();
const issueId = context.platformContext.issueId
const fieldKey = context.extensionContext.fieldId
const [cmtAuthor] = useState(async() => await commentTtl(context.platformContext.issueKey));
console.log(cmtAuthor);
const ltAr = cmtAuthor.length-1;
const lastAuthor = cmtAuthor[ltAr]?.author?.accountId;
//console.log(lastAuthor);
if(lastAuthor){
setCommentId({lastAuthor, issueId, fieldKey})
console.log(lastAuthor, issueId, fieldKey);
}
const {extensionContext: {fieldValue}} = useProductContext();
console.log(fieldValue);
return(
<CustomField>
<Text>{}</Text>
</CustomField>
);
};

 

john peter September 21, 2023

This is my code 

pls check and reply  to me

0 votes
john peter September 21, 2023

how to get display name in view screen with account Id

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events