# Mark posts as solved in an importer

**URL:** <https://meta.discourse.org/t/mark-posts-as-solved-in-an-importer/80146>\
**Category:** Development\
**Created:** [February 9, 2018, 12:23am UTC](https://meta.discourse.org/t/mark-posts-as-solved-in-an-importer/80146 "2018-02-09T00:23:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![andyh](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@andyh](https://meta.discourse.org/u/andyh)\
**Post date:** [September 14, 2018, 7:28pm UTC](https://meta.discourse.org/t/mark-posts-as-solved-in-an-importer/80146/5 "2018-09-14T19:28:26Z")

</div>

👋

Thanks for sharing your solutions @pfaffman and @vinothkannans

I just re-used your code:

```plaintext
post.custom_fields["is_accepted_answer"] = "true"
topic.custom_fields["accepted_answer_post_id"] = post.id
topic.save!
post.save!

```

This worked to an extent, I can see the solved status when I scroll to the accepted post, but the import fell-short in two ways:

1. Solved post is not quoted into 1st post of topic
2. Title of solved post on index page is not prepended with a ☑

I am parsing through the code in [plugin.rb](https://github.com/discourse/discourse-solved/blob/master/plugin.rb) but it’s a little beyond me… any ideas?

---

_[View the full topic](https://meta.discourse.org/t/mark-posts-as-solved-in-an-importer/80146)._
