Hi Team,
Not able to upload the documents to confluence page using shell script, getting below error
./test.sh
cat: target_page_id.txt: No such file or directory
Welcome to the Atlassian Community @Abhishek Rana
I think you have not mentioned absolute path of the "target_page_id.txt" file in your test.sh script or it is not yet created hence the not found error.
AB378389@C02FQ7ZZMD6M Desktop % pwd
/Users/AB378389/Desktop
AB378389@C02FQ7ZZMD6M Desktop % ./test.sh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you cat the script or paste the lines where target_page_id.txt is mentioned ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried in below way also. But no luck
/Users/AB378389/Desktop
AB378389@C02FQ7ZZMD6M Desktop % USER_NAME=abhishek.rana2@******.com
USER_PASSWORD=***********
CONFLUENCE_BASE_URL=https://abhishekrana17.atlassian.net/
ATTACHMENT_TYPE=image
ATTACHMENT_FILE_NAME=/Users/AB378389/Desktop/8sept.jpg
PAGE_ID=196757
curl -u $USER_NAME:$USER_PASSWORD \
-X POST \
-H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" \
${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment 2>/dev/null \
| jq -r '.results[].title'
zsh: command not found: jq
AB378389@C02FQ7ZZMD6M Desktop %
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You haven't got jq installed and in the path in that set of commands, and it has nothing to do with the error you've asked about either.
Could you stick with one thing please? Do you want to fix the problem you originally asked about, or debug the new thing with the jq error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.