-
Re: Prepopulate Discussion Body From URL Param
Ryan Rutan Feb 20, 2012 6:17 PM (in response to mroseni)This is definitely cryptic, but it is possible (with limitations). There is a not so publicized parameter called, unsanitaryBody (in Jive 4.5 and 5) that you can pass a string into and it will default the contents of a discussion body. The trick is that it has some limitations (primarily all those being a request parameter, 2k character limit, encodings, etc..), but for basic use-cases this should work. Just append the parameter to the end of the URL that is generated when you click "Create Discussion" and select a destination. Hope this helps.
Note: Because this parameter is not officially documented, it also means that it is not officially supported. It's name/functionality may change with the product as improvements are made. So please be sure to validate your use accordingly.
Also, not sure, but I would check to see if there is an idea to create an official variable for this...and make sure to vote it up.
-
Re: Prepopulate Discussion Body From URL Param
mroseni Feb 20, 2012 6:40 PM (in response to Ryan Rutan)Awesome, thanks Ryan! I appreciate the detailed response. It should work well for our simple use case. I'll check if it's an idea already, and create one if not. Thanks again!
-
Re: Prepopulate Discussion Body From URL Param
mroseni Sep 20, 2012 2:06 AM (in response to Ryan Rutan)Hey Ryan,
Does something like this exist for Tasks as well? I know I can pass in subject, tags, and due date, but it would be great if I could pass in what project to pre-select and some notes to default to.
I tried project, projectId, parentObjectId, containerId for the project, but no dice. I also tried body, notes, unsanitarybody, and anything else I could think of. Do you know what the parameter is for projects and notes?
Thanks,
Mike
-
Re: Prepopulate Discussion Body From URL Param
Ryan Rutan Sep 20, 2012 5:29 AM (in response to mroseni)1 person found this helpfulI do not believe there is a property like this for tasks :/
-
Re: Prepopulate Discussion Body From URL Param
mroseni Sep 20, 2012 5:16 PM (in response to Ryan Rutan)Ah, that's too bad, but thanks for getting back to me so quickly.
-
Re: Prepopulate Discussion Body From URL Param
mroseni Sep 20, 2012 7:28 PM (in response to Ryan Rutan)So I was digging around, and I got a little bit closer, but I'd like to understand what's happening for educational purposes. When I set the date a year from now and try to submit, I get an error saying it's too far out, but the subject, notes, and everything is pre-populated. Then, I changed the form to a GET so I could see what was being submitted, and sure enough, the Notes are submitted as "body". This time, I get an error saying it must be a POST for security reasons. OK, so I try to build a form with a post method like this:
<form action="/create-task.jspa" method="post">
<input type="hidden" name="jive.token.name" value="task.create.2386">
<input type="hidden" name="task.create.2386" value="1348189512759-INS3VFRBKAEOFA5EFYNP61UG0IHRS6O5">
<input type="hidden" name="owner" value="2386">
<input type="hidden" name="subject" value="Task Description">
<input type="hidden" name="project" value="8054">
<input type="hidden" name="dueDate" value="12/01/2100">
<input type="hidden" name="userLocale" value="en_US">
<input type="hidden" name="body" value="<body><p>my notes</p></body>">
<input type="hidden" name="tags" value="tag1 tag2">
<input type="submit" value="Create Task">
</form>
And in a very hackish way, this almost works. The date is too far in future, so the form populates the subject, dueDate, project, notes, and tags. However, after a few minutes, the token expires and the request is blocked. I see where the tokens are generated in the FTL (<@jive.token name="task.create.${user.ID?c}" />), but I'm wondering, is it possible to generate the security tokens in Javascript? Does Jive expose an API for this?
So then I change the action to /create-task!input.jspa and removed the tokens, but the body is no longer pre-populated. The textarea is being created like this: <textarea id='wysiwygtext' name="body" rows="15" cols="30">${body!?html}</textarea>
Does the input method just not assign body?
Thanks again!
-
-
-
Re: Prepopulate Discussion Body From URL Param
AnnaKravets Mar 5, 2013 9:25 PM (in response to Ryan Rutan)Ryan, please help with names of these parameters for Jive 6. Specially interested withpopulating tags for discussions with url. /discussion/create.jspa?&containerType=14&containerID=2003&tags=mytag - tags param doesn't work((
-
Re: Prepopulate Discussion Body From URL Param
Ryan Rutan Mar 5, 2013 9:39 PM (in response to AnnaKravets)In Jive 6, you will need to use my QuickTemplates v2 - Plugin to pre-populate these fields. Check out the link for the full documentation.
Note: This only works for Documents, Discussions, and BlogPosts.
-
Re: Prepopulate Discussion Body From URL Param
AnnaKravets Mar 6, 2013 12:26 AM (in response to Ryan Rutan)I see, thanks for quick response!)
-
-
-
-
Re: Prepopulate Discussion Body From URL Param
Ryan Rutan Feb 23, 2012 12:05 PM (in response to mroseni)It can be done. But it has its limits. I forget the parameter ... Off the top of my head, it's like "plainTextBody", but I know that isn't it. If you can ping me tomorrow, will look it up. I found it one day inspecting a form...pretty sure it might have some limitations...beyond the 2k GET barrier.
-
Re: Prepopulate Discussion Body From URL Param
AndresMejia Mar 8, 2012 2:21 PM (in response to Ryan Rutan)Is there a similar parameter to populate the discussion title?
I would like to send title with body.
If we could pull that off, we can sunset our old e-Mail "Feedback" application form.
-
Re: Prepopulate Discussion Body From URL Param
mroseni Mar 8, 2012 2:24 PM (in response to AndresMejia)Hi Andres, did you try passing "subject=mySubject" in the query string?
-
Re: Prepopulate Discussion Body From URL Param
AndresMejia Mar 16, 2012 9:30 AM (in response to mroseni)Thank you. That sounds right. We have not tried anything yet. I am in the gathering requirements and management support stage of this project. We are a few steps away from a prototype. Thank you for your Support!
-
-
-
-
Re: Prepopulate Discussion Body From URL Param
michalis Apr 8, 2014 6:42 AM (in response to mroseni)This post seems to be a bit out of date now. The unsanitaryBody parameter definitely does not work any more. Are there any parameters for prepopulating the body or a document, discussion or blog post in the current version of Jive? (and ideally without having to use a plug-in)
-
Re: Prepopulate Discussion Body From URL Param
markb Apr 17, 2014 8:56 AM (in response to michalis)I have this same question as well on my team... We had been using unsanitarybody a bit in previous version (thanks to this same thread) and with a little effort it worked great!
I see that Jive7 no longer uses plugins... My company is upgrading very soon to Jive7 and we would like to know if unsanitarybody still work or there is another alternative?
Thanks for any replies!
-
Re: Prepopulate Discussion Body From URL Param
susanprice Nov 16, 2014 5:00 PM (in response to michalis)I too have the same question. My company just migrated from Jive 5 to 7 and no more unsanitaryBody
. Would love to know how to pre-populate the discussions. Thanks!
-
Re: Prepopulate Discussion Body From URL Param
Alex Nassi Jan 15, 2016 1:41 PM (in response to michalis)Just came across this thread and wanted to bump it to see if anyone has come up with a workaround to the unsanitaryBody parameter?
-
-
Re: Prepopulate Discussion Body From URL Param
moesingh Jan 21, 2016 6:46 AM (in response to mroseni)1 person found this helpfulyou can use a javascript plugin to look at the parameters and populate the fields rather easily (except the tags!). much better than overlaying. I think you can do it in a few lines of code. let me know if you need more info
the tags are a pain. for jive 6, i had created a plugin that parses the doc and recomends tags based on word analysis (e.g. use nouns not verbs, use frequent stem verbs, etc.) but then they changed how tags worked in 7.0 and so it stopped working. you used to be able to just put a bunch of words in the tag box, but now it does something more "fancy" that i couldn't get a fix on.
-
Re: Prepopulate Discussion Body From URL Param
danthomas Aug 30, 2016 4:31 AM (in response to mroseni)did anyone find a non-plugin url only solution to this for jive 8?
-
Re: Prepopulate Discussion Body From URL Param
jgoldhammer Aug 30, 2016 11:15 AM (in response to mroseni)No, there is no solution AFAIK.
You have to wait for Jive 9...
-
Re: Prepopulate Discussion Body From URL Param
danthomas Aug 30, 2016 11:18 AM (in response to jgoldhammer)shame but good to know, thanks!
-
-
Re: Prepopulate Discussion Body From URL Param
efingdmi Mar 6, 2019 6:53 AM (in response to mroseni)still nothing for Jive 9?
it would be really helpful to create a prefilled document/discussion using a URL